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=2&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 13892 results for "fetch"(1808ms)

Migrating Deprecated HTTP Vals557 words

https://docs.val.town/troubleshooting/migrating-deprecated-http-vals/
request handler, and they’ll be cached between requests: // Expensive initialization or data fetching. const expensiveData = await fetchLargeDataset(); const cache = new Map(); export default async function (req: Request):

Sections

Intentionally caching values for performance!

request handler, and they’ll be cached between requests: // Expensive initialization or data fetching. const expensiveData = await fetchLargeDataset(); const cache = new Map(); export default async function (req: Request):

Runtime153 words

https://docs.val.town/reference/runtime/
to environment variables. The experimental Temporal API is enabled. Included environment. Section titled “Included environment” fetch to make HTTP requests. import from npm and https. Custom Types View the custom

Sections

Included environment

Included environment. Section titled “Included environment” fetch to make HTTP requests. import from npm and https. Custom Types View the custom types we support

Permissions935 words

https://docs.val.town/reference/permissions/
url: "http://localhost:3001/v1/fetch?url=https%3A%2F%2Fuser-secretEndpoint.web.val.run". } By supplying the environment variable in a header, I’m allowed access: With authenticationRun in Val Town ↗ import { fetch } from "https://esm.town/v/std/fetch"; const response = await

Sections

Exposing your vals to the internet

url: "http://localhost:3001/v1/fetch?url=https%3A%2F%2Fuser-secretEndpoint.web.val.run". } By supplying the environment variable in a header, I’m allowed access: With authenticationRun in Val Town ↗ import { fetch } from "https://esm.town/v/std/fetch"; const response = await

Upgrade to Deno728 words

https://docs.val.town/upgrading/upgrade-to-deno/
is to make room for the browser-standard Response type that is the result of a fetch request. The following image shows all three types used in parallel: req.body is no

Sections

ExpressJS types moved to express namespace

is to make room for the browser-standard Response type that is the result of a fetch request. The following image shows all three types used in parallel:

Recruitmain.tsx7 matches

@svc•Updated 3 hours ago
311 currentRecruitingSession.docSource = \`File: \${currentRecruitingSession.docName}\`;
312 currentRecruitingSession.step = 2;
313 fetchAndPopulateSuggestions();
314 }
315
364 let content = '';
365 if (isProcessing) {
366 content = \`<div class="card"><div class="magnifying-glass-loader" style="display:flex;"><div class="glass"></div><div class="handle"></div><p>Fetching suggestions...</p></div></div>\`;
367 } else if (suggestionsError) {
368 content = \`
402
403 if (suggestionsError) {
404 document.getElementById('retry-suggestions-btn').addEventListener('click', fetchAndPopulateSuggestions);
405 }
406
461 const formData = new FormData();
462 formData.append('documentFile', file, file.name);
463 const res = await fetch(window.location.pathname + '?action=suggestTasks&format=json', { method: 'POST', body: formData });
464 const data = await res.json().catch(() => { throw new Error(\`Server error: \${res.status}. Invalid JSON.\`); });
465 if (!res.ok || data.error) throw new Error(data.error || \`Server error: \${res.status}\`);
482}
483
484async function fetchAndPopulateSuggestions() {
485 currentRecruitingSession.isProcessing = true;
486 currentRecruitingSession.suggestionsError = null;
490 const formData = new FormData();
491 formData.append('documentText', currentRecruitingSession.docText.substring(0, 10000));
492 const res = await fetch(window.location.pathname + '?action=suggestTasks&format=json', { method: 'POST', body: formData });
493 const data = await res.json().catch(() => { throw new Error(\`Server returned non-JSON: \${res.status}\`); });
494 if (!res.ok || data.error) throw new Error(data.error || \`Server Error: \${res.status}\`);
635 formData.append('inputSourceDescription', currentRecruitingSession.docSource);
636
637 const res = await fetch(window.location.pathname + '?format=json', { method: 'POST', body: formData });
638 const data = await res.json().catch(() => { throw new Error(\`Server error: \${res.status}. Invalid JSON.\`); });
639 if (!res.ok || data.error) throw new Error(JSON.stringify(data.error || data.details) || \`Server error: \${res.status}\`);

stevensDemosendDailyBrief.ts1 match

@iabreufilho•Updated 3 hours ago
135 const lastSunday = today.startOf("week").minus({ days: 1 });
136
137 // Fetch relevant memories using the utility function
138 const memories = await getRelevantMemories();
139

FetchBasic2 file matches

@ther•Updated 4 days ago

GithubPRFetcher

@andybak•Updated 1 week ago