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/$2?q=fetch&page=32&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 13469 results for "fetch"(756ms)

markdown-embed.cursorrules3 matches

@stevekrouse•Updated 2 days ago
239
240 // Inject data to avoid extra round-trips
241 const initialData = await fetchInitialData();
242 const dataScript = `<script>
243 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
286
2875. **API Design:**
288 - `fetch` handler is the entry point for HTTP vals
289 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
290
291

markdown-embedchess.tsx2 matches

@stevekrouse•Updated 2 days ago
11
12 constructor() {}
13 async fetch(req: Request): Promise<Response> {
14 if (new URL(req.url).pathname === "/robots.txt") {
15 return new Response("User-agent: *\nDisallow: /");
250const sc = new StaticChess();
251
252export default analyticsHandlerWrapper(sc.fetch.bind(sc));
253

markdown-embedauth.ts3 matches

@stevekrouse•Updated 2 days ago
2 const method = c.req.method;
3 const secret = c.req.header("x-api-key"); // sent by Notion webhooks via POST
4 const fetchSite = c.req.header("sec-fetch-site");
5
6 // POSTs from Notion are automation webhooks that carry the x-api-key custom header
9 // for now we can just let GETs through without any auth shim
10 if (
11 (secret && secret !== Deno.env.get("X_API_KEY") || fetchSite && fetchSite !== "same-origin") && method !== "GET"
12 ) {
13 console.log(fetchSite);
14 return c.text("Unauthorized", 401);
15 }

osverify1 match

@dinavinter•Updated 2 days ago
22 });
23
24 const response = await fetch(url, {
25 method: "POST",
26 headers: { "Content-Type": "application/x-www-form-urlencoded" },

osds-schema.ts1 match

@dinavinter•Updated 2 days ago
22 });
23
24 const response = await fetch(url, {
25 method: "POST",
26 headers: { "Content-Type": "application/x-www-form-urlencoded" },

FarcasterSpacesSpace.tsx7 matches

@moe•Updated 2 days ago
7
8import { Button, Input, Section, ShareButton, Sheet } from '../components/ui.tsx'
9import { fetchUsersById } from '../util/neynar.ts'
10import { supabase, fetchSpace } from '../util/db.ts'
11
12import {
44 const { id } = useParams()
45
46 const { data: space, isLoading } = useQuery({ queryKey: ['space', id], queryFn: () => fetchSpace(id) })
47
48 const [calling, setCalling] = useState(false)
139
140 const queryFn = () =>
141 fetch(`/api/channels`)
142 .then((r) => r.json())
143 .then((r) => r?.data?.channels?.find((c) => c.channel_name == channel))
146
147 const join = async () => {
148 const response = await fetch(`/api/token?channel=${channel}&uid=${uid}`).then((r) => r.json())
149 console.log('response', response)
150 setToken(response.token)
448 if (!uid) return null
449 if (uid > 2_000_000) return null
450 return await fetchUsersById(`${uid}`).then((users) => users?.[0])
451}
452
479
480 useEffect(() => {
481 fetchSpace(id).then(setSpace)
482
483 const changes = supabase

utilsindex.ts1 match

@std•Updated 2 days ago
1export {
2 fetchTranspiledJavaScript,
3 listFiles,
4 readFile,

utilsmain.tsx1 match

@std•Updated 2 days ago
6 app.get("/", () => serveFile("/index.html", importMetaURL));
7 app.get("/**/*", c => serveFile(c.req.path, importMetaURL));
8 return app.fetch;
9}

val-town-pagesmain.tsx1 match

@mattrossman•Updated 2 days ago
18});
19
20export default app.fetch;

val-town-pagesmain.tsx1 match

@matt_hallway•Updated 2 days ago
18});
19
20export default app.fetch;

GithubPRFetcher

@andybak•Updated 2 days ago

proxiedfetch1 file match

@jayden•Updated 3 days ago