Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=fetch&page=662&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=fetch

Returns an array of strings in format "username" or "username/projectName"

Found 8056 results for "fetch"(1032ms)

whiteThrushmain.tsx1 match

@stevekrouse•Updated 1 year ago
146});
147
148export default passwordAuth(app.fetch);

password_authmain.tsx4 matches

@stevekrouse•Updated 1 year ago
60}
61
62async function fetchUser(token: string): Promise<{ id: string }> {
63 const resp = await fetch("https://api.val.town/v1/me", {
64 headers: {
65 Authorization: `Bearer ${token}`,
68
69 if (resp.status !== 200) {
70 throw new Error("Could not fetch user");
71 }
72
76async function verifyApiToken(token: string) {
77 try {
78 const [currentUser, requestUser] = await Promise.all([fetchUser(Deno.env.get("valtown")), fetchUser(token)]);
79 return currentUser.id == requestUser.id;
80 } catch (_) {
13app.get("/", (c) => c.html(Layout`${userActionsDisplay(c.get("auth"))}` as string));
14
15export default app.fetch;

cyanPanthermain.tsx1 match

@yusukebe•Updated 1 year ago
5app.get("/", (c) => c.text("Hello Val!!!"));
6
7export default app.fetch;

moccasinMoosemain.tsx1 match

@yusukebe•Updated 1 year ago
5app.get("/", (c) => c.text("Hello Val!"));
6
7export default app.fetch;

hellovalmain.tsx1 match

@yusukebe•Updated 1 year ago
5app.get("/", (c) => c.text("Hello Val!!!!!!"));
6
7export default app.fetch;

fetchJSON_examplemain.tsx4 matches

@stevekrouse•Updated 1 year ago
1import { fetch } from "https://esm.town/v/std/fetch?v=4";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4console.log(await fetchJSON("https://pie.dev/get"));
5console.log(await fetchJSON("https://pie.dev/get", { fetch }));

fetchJSON_exampleREADME.md1 match

@stevekrouse•Updated 1 year ago
1Migrated from folder: Archive/fetchJSON_example

lucia_demomain.tsx1 match

@pomdtr•Updated 1 year ago
212});
213
214export default codeOnValTown(router.fetch);

oldstylemain.tsx1 match

@easrng•Updated 1 year ago
30 | { type: "JSXInvalid"; value: string };
31
32let source = await (await fetch("https://unpkg.com/js-tokens@9.0.0/index.js")).text();
33source = source.replace(String.raw`Identifier = /(\x23?)`, String.raw`Identifier = /([@#]?)`);
34source = source.replace(

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago