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=291&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 3130 results for "fetch"(461ms)

stevekrouse_minimalmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/react */
2import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=46";
3import { email } from "https://esm.town/v/std/email?v=11";
4import { sqlite } from "https://esm.town/v/std/sqlite";
19}
20
21export const reactExample = modifyFetchHandler(async (request: Request) => {
22 const url = new URL(request.url);
23 if (url.pathname === "/favicon.ico") return new Response(null, { status: 404 });

insecureSSLCertExampleREADME.md1 match

@stevekrouse•Updated 1 year ago
1This is an example call of @stevekrouse/insecureFetch
2
3Migrated from folder: Archive/insecureSSLCertExample

whiteXerinaemain.tsx2 matches

@stevekrouse•Updated 1 year ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
3import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
4import { sqlToCSV, sqlToJSON } from "https://esm.town/v/nbbaier/sqliteExportHelpers";
147});
148
149export default modifyFetchHandler(passwordAuth(app.fetch));

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 (_) {

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

dateme_code_on_val_townmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=46";
2import dateme from "https://esm.town/v/stevekrouse/dateme";
3
4export default modifyFetchHandler(dateme);

aliasmain.tsx2 matches

@stevekrouse•Updated 1 year ago
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export function alias<P extends Params>(params: P): Promise<Result<P>> {
9 if ("valName" in params && params.token)
10 headers.Authorization = `Bearer ${params.token}`;
11 return fetchJSON(url, { headers });
12}
13type UserParams = {

ssr_react_minimain.tsx1 match

@stevekrouse•Updated 1 year ago
22 const onData = onSubmit ? onSubmit(e) : () => 1;
23 const formData = new FormData(e.target as any);
24 const resp = await fetch("/", {
25 method: props.action ?? "POST",
26 body: formData,

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago