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/$%7Bsuccess?q=fetch&page=619&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 9397 results for "fetch"(2033ms)

blob_adminmain.tsx2 matches

@lecoto•Updated 6 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";
143});
144
145export default modifyFetchHandler(passwordAuth(app.fetch, {
146 async getPassword() {
147 return await getOrSetPassword();

blob_adminmain.tsx2 matches

@bons•Updated 6 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));

tidyRedWhalemain.tsx1 match

@websrai•Updated 6 months ago
20
21 try {
22 const response = await fetch('/chat', {
23 method: 'POST',
24 headers: { 'Content-Type': 'application/json' },

modernSalesCRMmain.tsx9 matches

@shrirudragoud•Updated 6 months ago
76
77 useEffect(() => {
78 fetchLeads();
79 }, []);
80
81 const fetchLeads = async () => {
82 try {
83 const controller = new AbortController();
84 const timeoutId = setTimeout(() => controller.abort(), 5000);
85
86 const response = await fetch('/api/leads', {
87 signal: controller.signal
88 });
91
92 if (!response.ok) {
93 throw new Error('Failed to fetch leads');
94 }
95
97 setLeads(data);
98 } catch (error) {
99 console.error("Failed to fetch leads", error);
100 setError(error.message);
101 }
107 const timeoutId = setTimeout(() => controller.abort(), 5000);
108
109 const response = await fetch('/api/leads', {
110 method: 'POST',
111 headers: { 'Content-Type': 'application/json' },
120 }
121
122 await fetchLeads();
123 setNewLead({ name: '', email: '', phone: '', status: 'New' });
124 } catch (error) {
245 });
246 } catch (error) {
247 console.error('Fetch leads error:', error);
248 return new Response(JSON.stringify({ error: 'Failed to fetch leads' }), {
249 status: 500,
250 headers: { 'Content-Type': 'application/json' }

cerebras_codermain.tsx1 match

@zananowshad•Updated 6 months ago
23
24 try {
25 const response = await fetch("/", {
26 method: "POST",
27 body: JSON.stringify({ prompt, currentCode: code }),

blob_adminmain.tsx2 matches

@thobey•Updated 6 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));

dailySlackRoundupmain.tsx2 matches

@omerco•Updated 6 months ago
1import { fetch } from "https://esm.town/v/std/fetch";
2import { getDayName } from "https://esm.town/v/stevekrouse/getDayName?v=2";
3import process from "node:process";
4
5export const dailySlackRoundup = async () => {
6 const res = await fetch(process.env.BRAINBOT_WEBHOOK_URL, {
7 method: "POST",
8 body: JSON.stringify({

cerebras_codermain.tsx1 match

@omerco•Updated 6 months ago
23
24 try {
25 const response = await fetch("/", {
26 method: "POST",
27 body: JSON.stringify({ prompt, currentCode: code }),

uptimemain.tsx2 matches

@omerco•Updated 6 months ago
11 const start = performance.now();
12 try {
13 const res = await fetch(url);
14 end = performance.now();
15 status = res.status;
22 } catch (e) {
23 end = performance.now();
24 reason = `couldn't fetch: ${e}`;
25 ok = false;
26 console.log(`Website down (${url}): ${reason} (${end - start}ms)`);

weatherGPTmain.tsx1 match

@omerco•Updated 6 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());

proxyFetch2 file matches

@vidar•Updated 2 days ago

TAC_FetchBasic2 file matches

@A7_OMC•Updated 2 days ago