sapo-mag-filmes-em-cartazmain.tsx2 matches
5export default async (req?: Request) => {
6const url = "https://mag.sapo.pt/filmes/no-cinema";
7const r = await fetch(url);
8if (!r.ok)
9return new Response("Failed to fetch data", { status: 502 });
1011const text = await r.text();
HelloWorld2server.tsx1 match
6.get("/foo", (c) => c.text("hello", 200));
78export default app.fetch;
328currentAnalysisSession.docSource = \`File: \${currentAnalysisSession.docName}\`;
329currentAnalysisSession.step = 2;
330fetchAndPopulateSuggestions();
331}
332
420
421if (suggestionsError) {
422document.getElementById('retry-suggestions-btn').addEventListener('click', fetchAndPopulateSuggestions);
423}
424
479const formData = new FormData();
480formData.append('documentFile', file, file.name);
481const res = await fetch(window.location.pathname + '?action=suggestTasks&format=json', { method: 'POST', body: formData });
482const data = await res.json().catch(() => { throw new Error(\`Server error: \${res.status}. Invalid JSON.\`); });
483if (!res.ok || data.error) throw new Error(data.error || \`Server error: \${res.status}\`);
500}
501502async function fetchAndPopulateSuggestions() {
503currentAnalysisSession.isProcessing = true;
504currentAnalysisSession.suggestionsError = null;
508const formData = new FormData();
509formData.append('documentText', currentAnalysisSession.docText.substring(0, 10000));
510const res = await fetch(window.location.pathname + '?action=suggestTasks&format=json', { method: 'POST', body: formData });
511const data = await res.json().catch(() => { throw new Error(\`Server returned non-JSON: \${res.status}\`); });
512if (!res.ok || data.error) throw new Error(data.error || \`Server Error: \${res.status}\`);
654formData.append('inputSourceDescription', currentAnalysisSession.docSource);
655656const res = await fetch(window.location.pathname + '?format=json', { method: 'POST', body: formData });
657const data = await res.json().catch(() => { throw new Error(\`Server error: \${res.status}. Invalid JSON.\`); });
658if (!res.ok || data.error) throw new Error(JSON.stringify(data.error || data.details) || \`Server error: \${res.status}\`);
brokenLinkCrawlerurlGetter.tsx2 matches
30let html = "";
31try {
32const response = await fetch(linkObject.url);
33const contentType = response.headers.get("content-type") || "";
34if (!contentType.includes("text/html")) continue;
35html = await response.text();
36} catch (err) {
37console.warn("Fetch failed for", linkObject.url, err);
38continue;
39}
Synthesizemain.tsx2 matches
72});
7374// Export the Hono app's fetch handler, which is the standard for Val Town HTTP endpoints
75export default app.fetch;
Townietext-editor.ts1 match
166let type_: "file" | "http" | "script";
167if (path.includes("backend/index.ts")) type_ = "http";
168if (file_text?.includes("export default app.fetch")) type_ = "http";
169if ([".ts", ".tsx", ".js", ".jsx"].some(ext => path.endsWith(ext))) {
170type_ = "script";
TownieMessages.tsx9 matches
256</>
257);
258case "fetch":
259return (
260<Details
269summary={(
270<>
271<div>fetch:</div>
272<div>{args?.valPath}</div>
273<div>{args?.urlPath || "/"}</div>
275)}>
276{result?.type === "success" ? (
277<div className="fetch-result">
278<div className="fetch-header">
279<span className={`status-badge ${result.data.status >= 200 && result.data.status < 300 ? 'success' :
280result.data.status >= 300 && result.data.status < 400 ? 'redirect' :
284<span className="response-time">{result.data.responseTime}ms</span>
285</div>
286<div className="fetch-section">
287<h4>Headers</h4>
288<pre className="fetch-headers">{JSON.stringify(result.data.headers, null, 2)}</pre>
289</div>
290<div className="fetch-section">
291<h4>Response Body</h4>
292<pre className="fetch-body">
293{typeof result.data.body === 'object'
294? JSON.stringify(result.data.body, null, 2)
298</div>
299) : (
300<div className="fetch-error">
301<h4>Error</h4>
302<pre>{result?.message || "Unknown error"}</pre>
untitled-2285main.tsx1 match
7});
89export default app.fetch;
18const start = performance.now();
19try {
20res = await fetch(url);
21end = performance.now();
22status = res.status;
28} catch (e) {
29end = performance.now();
30reason = `couldn't fetch: ${e}`;
31ok = false;
32}
kebede-and-ben-testApp.tsx2 matches
16
17try {
18const response = await fetch('/api/game', {
19method: 'POST',
20headers: {
47const moveData: MoveRequest = { position };
48
49const response = await fetch(`/api/game/${game.id}/move`, {
50method: 'PUT',
51headers: {