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=78&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 7501 results for "fetch"(466ms)

stevensDemoindex.ts2 matches

@swriddle•Updated 1 week ago
135 ));
136
137// HTTP vals expect an exported "fetch handler"
138export default app.fetch;

stevensDemo.cursorrules5 matches

@swriddle•Updated 1 week ago
163```
164
1655. **fetchTranspiledJavaScript** - Fetch and transpile TypeScript to JavaScript:
166```ts
167const jsCode = await fetchTranspiledJavaScript("https://esm.town/v/username/project/path/to/file.ts");
168```
169
242
243 // Inject data to avoid extra round-trips
244 const initialData = await fetchInitialData();
245 const dataScript = `<script>
246 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
300
3015. **API Design:**
302 - `fetch` handler is the entry point for HTTP vals
303 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
304 - Properly handle CORS if needed for external access

aab65694896_.cursorrules3 matches

@vtclitests•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

vtEditorFiles.cursorrules3 matches

@wolf•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

FarcasterMiniAppStoreimage.tsx2 matches

@moe•Updated 1 week ago
82 const fontPromises = fontsConfig.map(async (font) => {
83 const fontUrl = "https://cdn.jsdelivr.net/npm/@tamagui/font-inter@1.108.3/otf/" + font.fontFile;
84 const fontArrayBuf = await fetch(fontUrl).then((res) => res.arrayBuffer());
85 return { name: font.name, data: fontArrayBuf, weight: font.weight };
86 });
93 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
94 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`;
95 return fetch(api).then((r) => r.text());
96};
97

OpenTowniexuseProjectFiles.ts4 matches

@tallesjp•Updated 1 week ago
1import { useState, useEffect } from "https://esm.sh/react@18.2.0?dev";
2import { fetchProjectFiles } from "../utils/api.ts";
3
4interface UseProjectFilesProps {
15
16/**
17 * Custom hook to fetch and manage project files
18 */
19export function useProjectFiles({
38
39 try {
40 const filesData = await fetchProjectFiles({
41 bearerToken,
42 projectId,
51 }
52 } catch (err) {
53 console.error("Error fetching project files:", err);
54 setProjectFiles([]);
55 setError(err instanceof Error ? err : new Error(String(err)));

OpenTowniextext-editor.ts1 match

@tallesjp•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";

OpenTowniexsystem_prompt.txt3 matches

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

OpenTowniexsend-message.ts3 matches

@tallesjp•Updated 1 week ago
95 }
96
97 // If there are selected files, fetch their content and add them to the messages
98 if (selectedFiles && selectedFiles.length > 0) {
99 const vt = new ValTown({ bearerToken });
115 fileContents += `## File: ${filePath}\n\`\`\`\n${fileWithLinesNumbers(content)}\n\`\`\`\n\n`;
116 } catch (error) {
117 console.error(`Error fetching file ${filePath}:`, error);
118 fileContents += `## File: ${filePath}\nError: Could not fetch file content\n\n`;
119 }
120 }

OpenTowniexProjects.tsx1 match

@tallesjp•Updated 1 week ago
10
11async function loader({ bearerToken }: { bearerToken: string }) {
12 const data = await (await fetch("/api/projects-loader", {
13 headers: {
14 "Authorization": "Bearer " + bearerToken,

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago