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%20%22Optional%20title%22?q=fetch&page=25&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 8409 results for "fetch"(533ms)

Townieusage-dashboard.ts3 matches

@charmaine•Updated 3 days ago
59 // If we get here, authentication was successful
60
61 // Fetch all rows from the usage table
62 // Fetch all rows from the usage table
63 const allUsageData = await sqlite.execute(`SELECT * FROM ${USAGE_TABLE} ORDER BY timestamp DESC`);
64
65 // Fetch aggregated data grouped by user_id
66 const groupedUsageData = await sqlite.execute(`
67 SELECT

TownieTODOs.md1 match

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

Townietext-editor.ts1 match

@charmaine•Updated 3 days 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";

Towniesystem_prompt.txt3 matches

@charmaine•Updated 3 days ago
233
234 // Inject data to avoid extra round-trips
235 const initialData = await fetchInitialData();
236 const dataScript = `<script>
237 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
280
2815. **API Design:**
282 - `fetch` handler is the entry point for HTTP vals
283 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`

Towniesend-message.ts3 matches

@charmaine•Updated 3 days ago
87 }
88
89 // If there are selected files, fetch their content and add them to the messages
90 if (selectedFiles && selectedFiles.length > 0) {
91 const vt = new ValTown({ bearerToken });
107 fileContents += `## File: ${filePath}\n\`\`\`\n${fileWithLinesNumbers(content)}\n\`\`\`\n\n`;
108 } catch (error) {
109 console.error(`Error fetching file ${filePath}:`, error);
110 fileContents += `## File: ${filePath}\nError: Could not fetch file content\n\n`;
111 }
112 }

Townieproject-files.ts2 matches

@charmaine•Updated 3 days 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});

Townieproject-branches.ts2 matches

@charmaine•Updated 3 days 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});

TownieLayoutRoute.tsx1 match

@charmaine•Updated 3 days ago
4
5export function LayoutRoute () {
6 // TODO fetch here because we're not doing any caching
7 // and we want the user data in the header ?
8 // const projects = useProjects();

Townieindex.ts1 match

@charmaine•Updated 3 days ago
62});
63
64export default app.fetch;
65

Townieindex.ts1 match

@charmaine•Updated 3 days ago
21
22// This is the entry point for HTTP vals
23export default app.fetch;
24

fetchPaginatedData2 file matches

@nbbaier•Updated 2 weeks ago

FetchBasic1 file match

@fredmoon•Updated 2 weeks ago