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=139&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 9900 results for "fetch"(638ms)

Townie-02text-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-02send-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-02requests.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-02project-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-02project-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-02LayoutRoute.tsx1 match

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

Townie-02index.ts1 match

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

Townie-02ChatRoute.tsx8 matches

@jxnblk•Updated 1 week ago
45 files={project.data?.files}
46 branchId={branchId}
47 refetch={project.refetch}
48 />
49 </>
55 files,
56 branchId,
57 refetch,
58}: {
59 project: any;
60 files: any[];
61 branchId: string;
62 refetch: () => void;
63}) {
64 const [images, setImages] = useState<(string|null)[]>([]);
89 if (!messages?.length) return;
90 let last = messages.at(-1);
91 if (shouldRefetch(last)) {
92 refetch();
93 }
94 }, [messages]);
173}
174
175function shouldRefetch (message) {
176 for (let i = 0; i < message?.parts?.length; i++) {
177 let part = message.parts[i];
180 case "str_replace_editor":
181 if (part.toolInvocation?.args?.command === "create") {
182 // console.log("REFETCH (create)");
183 return true;
184 }
186 case "delete_file":
187 case "change_val_type":
188 // console.log("REFETCH (change type or delete)");
189 return true;
190 }

town-hallSpeakerForm.tsx1 match

@stevekrouse•Updated 1 week ago
37
38 try {
39 const response = await fetch("/submit", {
40 method: "POST",
41 headers: {

cerebras_codermain.tsx1 match

@poarox•Updated 1 week ago
182
183 try {
184 const response = await fetch("/", {
185 method: "POST",
186 body: JSON.stringify({

agentplex-deal-flow-email-fetch1 file match

@anandvc•Updated 1 day ago

proxyFetch2 file matches

@vidar•Updated 4 days ago