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=224&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 8143 results for "fetch"(498ms)

OpenTownieuseProjectFiles.ts4 matches

@nulo•Updated 3 weeks 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)));

OpenTownietext-editor.ts1 match

@nulo•Updated 3 weeks ago
128 let type_: "file" | "http" | "script";
129 if (path.includes("backend/index.ts")) type_ = "http";
130 if (file_text?.includes("export default app.fetch")) type_ = "http";
131 if ([".ts", ".tsx", ".js", ".jsx"].some(ext => path.endsWith(ext))) {
132 type_ = "script";

OpenTowniesystem_prompt.txt3 matches

@nulo•Updated 3 weeks ago
190
191 // Inject data to avoid extra round-trips
192 const initialData = await fetchInitialData();
193 const dataScript = `<script>
194 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
237
2385. **API Design:**
239 - `fetch` handler is the entry point for HTTP vals
240 - Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`

OpenTownieProjects.tsx1 match

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

OpenTownieproject-files.ts2 matches

@nulo•Updated 3 weeks 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});

OpenTownieproject-branches.ts2 matches

@nulo•Updated 3 weeks 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});

OpenTownieindex.ts1 match

@nulo•Updated 3 weeks ago
32});
33
34export default app.fetch;

OpenTownieindex.ts1 match

@nulo•Updated 3 weeks ago
17
18// This is the entry point for HTTP vals
19export default app.fetch;

OpenTownieCreateProject.tsx1 match

@nulo•Updated 3 weeks ago
32
33 try {
34 const response = await fetch("/api/create-project", {
35 method: "POST",
36 headers: {

OpenTownieCreateBranch.tsx1 match

@nulo•Updated 3 weeks ago
43
44 try {
45 const response = await fetch("/api/create-branch", {
46 method: "POST",
47 headers: {

fetchPaginatedData2 file matches

@nbbaier•Updated 1 week ago

FetchBasic1 file match

@fredmoon•Updated 1 week ago