1
2
3
4
5
6
7
8
9
10
11
12
13
import { fetchPaginatedData } from "https://esm.town/v/nbbaier/fetchPaginatedData";
import { paginatedResponse } from "https://esm.town/v/nbbaier/paginatedResponse";
const id = "5d1042a9-7b0b-499d-8a72-3a8ac7a4e185";
const res = await fetchPaginatedData(`https://api.val.town/v1/users/${id}/vals`, {
headers: { Authorization: `Bearer ${Deno.env.get("valtown")}` },
});
const vals = res.filter((v) => v.name.includes("untitled") && !v.code.includes("// #delete"));
export default async function(req: Request): Promise<Response> {
return paginatedResponse(req, vals);
}
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.