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/image-url.jpg?q=fetch&page=144&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 10123 results for "fetch"(716ms)

Townie-05useBranches.tsx4 matches

@jxnblk•Updated 1 week ago
7 const [loading, setLoading] = useState(true);
8
9 const fetchData = async () => {
10 const endpoint = new URL(ENDPOINT, window.location.origin);
11 endpoint.searchParams.append("projectId", projectId);
12
13 const res = await fetch(endpoint)
14 .then(res => res.json());
15 setData(res.branches);
19 useEffect(() => {
20 if (!projectId) return;
21 fetchData();
22 }, [projectId]);
23
24 return { data, loading, refetch: fetchData };
25}

Townie-05TODOs.md1 match

@jxnblk•Updated 1 week ago
47<!--
48
49- [x] refetch project data on create/etc
50- [x] Loading favicon
51- [x] Ensure main branch is default selected

Townie-05text-editor.ts1 match

@jxnblk•Updated 1 week ago
136 let type_: "file" | "http" | "script";
137 if (path.includes("backend/index.ts")) type_ = "http";
138 if (file_text?.includes("export default app.fetch")) type_ = "http";
139 if ([".ts", ".tsx", ".js", ".jsx"].some(ext => path.endsWith(ext))) {
140 type_ = "script";

Townie-05system_prompt.txt3 matches

@jxnblk•Updated 1 week ago
234
235 // Inject data to avoid extra round-trips
236 const initialData = await fetchInitialData();
237 const dataScript = `<script>
238 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
281
2825. **API Design:**
283 - `fetch` handler is the entry point for HTTP vals
284 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
285

Townie-05send-message.ts3 matches

@jxnblk•Updated 1 week ago
103 }
104
105 // If there are selected files, fetch their content and add them to the messages
106 if (selectedFiles && selectedFiles.length > 0) {
107 const vt = new ValTown({ bearerToken });
123 fileContents += `## File: ${filePath}\n\`\`\`\n${fileWithLinesNumbers(content)}\n\`\`\`\n\n`;
124 } catch (error) {
125 console.error(`Error fetching file ${filePath}:`, error);
126 fileContents += `## File: ${filePath}\nError: Could not fetch file content\n\n`;
127 }
128 }

Townie-05requests.ts2 matches

@jxnblk•Updated 1 week ago
56 row.parentNode.insertBefore(newRow, row.nextSibling);
57
58 // Fetch the inference calls data
59 fetch('/api/inference-calls?usage_id=' + usageId)
60 .then(response => response.json())
61 .then(data => {

Townie-05project-files.ts2 matches

@jxnblk•Updated 1 week ago
30 return c.json({ files: files.data });
31 } catch (error) {
32 console.error("Error fetching project files:", error);
33 return Response.json({ error: "Failed to fetch project files" }, { status: 500 });
34 }
35});

Townie-05project-branches.ts2 matches

@jxnblk•Updated 1 week ago
21 return c.json({ branches: branches.data });
22 } catch (error) {
23 console.error("Error fetching branches:", error);
24 return Response.json({ error: "Failed to fetch branches" }, { status: 500 });
25 }
26});

Townie-05index.ts1 match

@jxnblk•Updated 1 week ago
21
22// This is the entry point for HTTP vals
23export default app.fetch;
24

Townie-05.cursorrules3 matches

@jxnblk•Updated 1 week 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

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 3 days ago

proxyFetch2 file matches

@vidar•Updated 5 days ago