boombox-generatormain.ts1 match
50// });
5152export default app.fetch;
53
weatherAppmain.tsx3 matches
1516useEffect(() => {
17async function fetchWeather() {
18const url = `https://api.open-meteo.com/v1/forecast?latitude=${city.lat}&longitude=${city.lon}¤t_weather=true`;
19const res = await fetch(url);
20const data = await res.json();
21setWeather(data.current_weather);
22}
23fetchWeather();
24}, [city]);
25
269
270// Network-specific guidance
271if (error.name === 'TypeError' && error.message.includes('fetch')) {
272errorHtml += '<div class="error-details">';
273errorHtml += '<strong>🌐 Network Error Troubleshooting:</strong>\\n';
406407try {
408const response = await fetch('https://integrate.api.nvidia.com/v1/chat/completions', {
409method: 'POST',
410headers: requestHeaders,
442
443// Re-throw with additional context if it's a network error
444if (error.name === 'TypeError' && error.message.includes('fetch')) {
445const networkError = new Error(\`Network Error: \${error.message}\`);
446networkError.name = 'NetworkError';
36app.onError((err) => Promise.reject(err));
3738// 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
315};
316try {
317const res = await fetch('/api/email',
318{
319method: 'POST',
untitled-8620main.ts2 matches
419
420try {
421const response = await fetch(\`\${API_BASE_URL}/start\`, {
422method: 'POST',
423headers: { 'Content-Type': 'application/json' },
442const pollJobStatus = async () => {
443try {
444const response = await fetch(\`\${API_BASE_URL}/status?jobId=\${jobId}\`);
445if (!response.ok) throw new Error('Polling failed');
446
144145#### **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
151196```javascript
197// Internal call from within Val (no authentication needed)
198const response = await fetch('/api/demo/page-id/properties');
199const data = await response.json();
2002765. **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
151152app.onError((err) => Promise.reject(err));
153export default liveReload(lastlogin(app.fetch), import.meta.url);
299// Make API request
300async function makeApiRequest(requestData, apiKey) {
301const response = await fetch('https://integrate.api.nvidia.com/v1/chat/completions', {
302method: 'POST',
303headers: {
untitled-7971main.ts1 match
12};
1314const response = await fetch(`${BASE_URL}/chat/completions`, {
15method: "POST",
16headers: {