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=553&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 8238 results for "fetch"(1081ms)

allvalsindexmain.tsx2 matches

@ejfox•Updated 8 months ago
19
20 useEffect(() => {
21 fetch('/vals')
22 .then(response => {
23 if (!response.ok) {
39 })
40 .catch(error => {
41 console.error('Error fetching vals:', error);
42 setError(error.toString());
43 setLoading(false);

sqliteExplorerAppmain.tsx4 matches

@feb•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

blob_adminmain.tsx2 matches

@snptrs•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));

sketchmain.tsx1 match

@ff6347•Updated 8 months ago
11 const imageUrl = "https://charlypoly-httpapiscreenshotpageexample.web.val.run/?url=" + url.origin
12 // return Response.redirect(imageUrl, 302)
13 const res = await fetch(imageUrl)
14 const blob = await res.blob()
15 return new Response(blob, { headers: { "Content-Type": "image/png" } })

calculateTransitAPImain.tsx4 matches

@rochambeau314•Updated 8 months ago
82 const distanceMatrixUrl = `https://maps.googleapis.com/maps/api/distancematrix/json?origins=${encodeURIComponent(origin)}&destinations=${encodeURIComponent(destinations)}&mode=driving&key=${apiKey}`;
83
84 const response = await fetch(distanceMatrixUrl);
85 const data = await response.json();
86
117 }
118
119 const directionsResponse = await fetch(directionsUrl);
120 const directionsData = await directionsResponse.json();
121
132 const directionsUrl = `https://maps.googleapis.com/maps/api/directions/json?origin=${encodeURIComponent(origin)}&destination=${encodeURIComponent(destination)}&mode=transit&key=${apiKey}`;
133
134 const directionsResponse = await fetch(directionsUrl);
135 const directionsData = await directionsResponse.json();
136
146async function getZipCode(address: string, apiKey: string): Promise<string> {
147 const geocodeUrl = `https://maps.googleapis.com/maps/api/geocode/json?address=${encodeURIComponent(address)}&key=${apiKey}`;
148 const response = await fetch(geocodeUrl);
149 const data = await response.json();
150

fluxImageGeneratormain.tsx1 match

@danyslicer•Updated 8 months ago
81 setError("");
82 try {
83 const response = await fetch("/generate", {
84 method: "POST",
85 headers: { "Content-Type": "application/json" },

weatherGPTmain.tsx1 match

@tgrv•Updated 8 months ago
4let location = "Wolfsburg";
5let lang = "de";
6const weather = await fetch(
7 `https://wttr.in/${location}?lang=${lang}&format=j1`,
8).then(r => r.json());

verySalmonEmumain.tsx1 match

@tgrv•Updated 8 months ago
4let location = "brooklyn ny";
5let lang = "en";
6const weather = await fetch(
7 `https://wttr.in/${location}?lang=${lang}&format=j1`,
8).then(r => r.json());

sqliteExplorerAppmain.tsx4 matches

@teamgroove•Updated 8 months ago
1/** @jsxImportSource https://esm.sh/hono@latest/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176
177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));

aiTextEditormain.tsx1 match

@sharanbabu•Updated 8 months ago
131
132 try {
133 const response = await fetch("/process", {
134 method: "POST",
135 headers: { "Content-Type": "application/json" },

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago