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=232&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 2376 results for "fetch"(441ms)

reactRouter7server.tsx1 match

@charmaine•Updated 2 months ago
5 if (url.pathname == "/js/entry.client.js") {
6 const moduleUrl = new URL("./entry.client.tsx", import.meta.url);
7 return fetch(moduleUrl);
8 }
9 return handler(request);

reactRouter7layout.client.ts2 matches

@charmaine•Updated 2 months ago
3export async function loader({ request }: LoaderFunctionArgs) {
4 let url = new URL(request.url);
5 let res = await fetch(url, {
6 headers: {
7 Accept: "application/json",
15 let url = new URL(request.url);
16 // call the server action
17 let res = await fetch(url, {
18 method: "POST",
19 body: new URLSearchParams(await request.formData()),

feedbackmain.ts1 match

@pomdtr•Updated 2 months ago
2
3export default async function(req: Request): Promise<Response> {
4 const markdown = await fetch(import.meta.resolve("./README.md")).then(res => res.text());
5 const url = new URL(req.url);
6

spotifyOauthServerserver1 match

@charmaine•Updated 2 months ago
140});
141
142export default app.fetch;

spotifyOauthServerserver1 match

@neverstew•Updated 2 months ago
140});
141
142export default app.fetch;

vblogimport-file1 match

@jxnblk•Updated 2 months ago
2export async function importFile(path: string) {
3 const url = new URL(path, import.meta.url);
4 const res = await fetch(url, { redirect: "follow" });
5 if (!res.ok) return null;
6 return await res.text();

Windsurfprojectcontext8 matches

@toowired•Updated 2 months ago
51
52 useEffect(() => {
53 fetchState();
54 }, []);
55
56 /**
57 * Fetches the current state from the server
58 */
59 const fetchState = async () => {
60 setIsLoading(true);
61 setError(null);
62 try {
63 const response = await fetch("/api/state");
64 if (!response.ok) throw new Error("Failed to fetch state");
65 const data = await response.json();
66 setState(data);
80 setError(null);
81 try {
82 const response = await fetch("/api/state", {
83 method: "POST",
84 headers: { "Content-Type": "application/json" },
86 });
87 if (!response.ok) throw new Error("Failed to update state");
88 await fetchState();
89 } catch (err) {
90 setError(err.message);
565 if (webhookUrl) {
566 try {
567 await fetch(webhookUrl, {
568 method: "POST",
569 headers: { "Content-Type": "application/json" },

prolificPinkGullmain.ts1 match

@chris_st•Updated 2 months ago
7countPath(app);
8
9export default app.fetch;

trackESMContentmain.tsx3 matches

@shouser•Updated 2 months ago
10const TABLE_NAME = `${KEY}_versions_v1`;
11
12async function fetchContent(url: string) {
13 const response = await fetch(url);
14 return await response.text();
15}
30
31 for (const url of URLS) {
32 const content = await fetchContent(url);
33 const latestVersion = await sqlite.execute(
34 `SELECT blob_key FROM ${TABLE_NAME} WHERE url = ? ORDER BY timestamp DESC LIMIT 1`,

prolificPinkGulltest.ts1 match

@chris_st•Updated 2 months ago
11const supabase = createClient(supabaseUrl, supabaseKey)
12
13// Disable prefetch as it is not supported for "Transaction" pool mode
14export const client = postgres(connectionString, { prepare: false })

fetchPaginatedData2 file matches

@nbbaier•Updated 3 days ago

tweetFetcher2 file matches

@nbbaier•Updated 1 week ago