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//%22$%7Bconfig.siteUrl%7D/%22?q=fetch&page=3&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 18997 results for "fetch"(716ms)

boombox-generatormain.ts1 match

@danfishgoldUpdated 10 hours ago
50// });
51
52export default app.fetch;
53

weatherAppmain.tsx3 matches

@dcm31Updated 10 hours ago
15
16 useEffect(() => {
17 async function fetchWeather() {
18 const url = `https://api.open-meteo.com/v1/forecast?latitude=${city.lat}&longitude=${city.lon}&current_weather=true`;
19 const res = await fetch(url);
20 const data = await res.json();
21 setWeather(data.current_weather);
22 }
23 fetchWeather();
24 }, [city]);
25
269
270 // Network-specific guidance
271 if (error.name === 'TypeError' && error.message.includes('fetch')) {
272 errorHtml += '<div class="error-details">';
273 errorHtml += '<strong>🌐 Network Error Troubleshooting:</strong>\\n';
406
407 try {
408 const response = await fetch('https://integrate.api.nvidia.com/v1/chat/completions', {
409 method: 'POST',
410 headers: requestHeaders,
442
443 // Re-throw with additional context if it's a network error
444 if (error.name === 'TypeError' && error.message.includes('fetch')) {
445 const networkError = new Error(\`Network Error: \${error.message}\`);
446 networkError.name = 'NetworkError';

qbatindex.ts2 matches

@wilhelmUpdated 10 hours ago
36app.onError((err) => Promise.reject(err));
37
38// HTTP vals expect an exported "fetch handler"
39// This is how you "run the server" in Val Town with Hono
40export default app.fetch;

sachersolindex.html1 match

@yawnxyzUpdated 11 hours ago
315 };
316 try {
317 const res = await fetch('/api/email',
318 {
319 method: 'POST',

untitled-8620main.ts2 matches

@knowUpdated 11 hours ago
419
420 try {
421 const response = await fetch(\`\${API_BASE_URL}/start\`, {
422 method: 'POST',
423 headers: { 'Content-Type': 'application/json' },
442 const pollJobStatus = async () => {
443 try {
444 const response = await fetch(\`\${API_BASE_URL}/status?jobId=\${jobId}\`);
445 if (!response.ok) throw new Error('Polling failed');
446
144
145#### **Agent Data Integration**
146- **Real-time Agent Updates**: Fetches agent data every 5 seconds when user is authorized
147- **Conditional Display**: Remote support section only appears when agents array has at least one item
148- **Complete Agent Information**: Shows all blob contents including pageId, agents array, lastUpdated, and assignedAt timestamps
149- **Authorization-based**: Only fetches agent data for authorized users (matching email addresses)
150- **Error Handling**: Silent console logging for missing agent data without disrupting user experience
151
196```javascript
197// Internal call from within Val (no authentication needed)
198const response = await fetch('/api/demo/page-id/properties');
199const data = await response.json();
200
2765. **STEP 1: Clear Current Demo Blob** - Immediately clears the agent blob for this demo
2776. **STEP 2: Find New Agents** - Queries agents database by Assigned property
2787. **STEP 3: Collect Agent Data** - Fetches complete agent information and validates
2798. **STEP 4: Clear Agents from Other Demo Blobs** - Removes agents from any other demo blobs to prevent double-assignment
2809. **STEP 5: Update Current Demo Blob** - Stores new agent assignments in the current demo's blob
295**Error Handling & Reliability:**
296- **Transactional Approach**: Collects all required data before making any changes
297- **Early Validation**: Aborts assignment if any agent data cannot be fetched
298- **Atomic Updates**: Critical Notion updates happen together or not at all
299- **Non-Blocking Blob Operations**: Both blob updates and blob clearing are non-blocking

blob_adminmain.tsx1 match

@danfishgoldUpdated 13 hours ago
151
152app.onError((err) => Promise.reject(err));
153export default liveReload(lastlogin(app.fetch), import.meta.url);
299 // Make API request
300 async function makeApiRequest(requestData, apiKey) {
301 const response = await fetch('https://integrate.api.nvidia.com/v1/chat/completions', {
302 method: 'POST',
303 headers: {

untitled-7971main.ts1 match

@ashket3Updated 15 hours ago
12 };
13
14 const response = await fetch(`${BASE_URL}/chat/completions`, {
15 method: "POST",
16 headers: {

FetchBasic2 file matches

@bengoldUpdated 2 weeks ago

fetch1 file match

@raifyUpdated 2 weeks ago