joinMatrixRoommain.tsx2 matches
1import { fetch } from "https://esm.town/v/std/fetch";
23export const joinMatrixRoom = async (
17},
18};
19return await fetch(url, config);
20};
blob_adminmain.tsx2 matches
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138139export default modifyFetchHandler(passwordAuth(app.fetch));
blob_adminmain.tsx2 matches
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138139export default modifyFetchHandler(passwordAuth(app.fetch));
calculateTransitTimeValmain.tsx15 matches
1415useEffect(() => {
16fetchSavedResults();
17}, []);
1819const fetchSavedResults = async () => {
20try {
21const response = await fetch("/getSavedResults");
22if (response.ok) {
23const data = await response.json();
25}
26} catch (err) {
27console.error("Error fetching saved results:", err);
28}
29};
33console.log("Calculating travel times for origin:", origin);
34try {
35const response = await fetch(`/calculate?origin=${encodeURIComponent(origin)}`);
36const data = await response.json();
37console.log("Received response:", data);
51const deleteResult = async (index) => {
52try {
53const response = await fetch(`/deleteResult?index=${index}`, { method: "DELETE" });
54if (response.ok) {
55setResults(prevResults => prevResults.filter((_, i) => i !== index));
169});
170} catch (error) {
171console.error("Error fetching saved results:", error);
172return new Response(JSON.stringify({ error: "Failed to fetch saved results" }), {
173status: 500,
174headers: { "Content-Type": "application/json" },
231const { blob } = await import("https://esm.town/v/std/blob");
232233console.log("Fetching grocery and gym data");
234const groceries = await blob.getJSON("SF_Grocery");
235const gyms = await blob.getJSON("SF_Gyms");
236console.log(`Fetched ${groceries.length} groceries and ${gyms.length} gyms`);
237238console.log("Finding nearest grocery");
328}&destinations=${encodeURIComponent(destinations)}&mode=driving&key=${apiKey}`;
329330console.log(`Fetching from Distance Matrix API for batch ${i / batchSize + 1}`);
331const response = await fetch(distanceMatrixUrl);
332const data = await response.json();
333console.log("Distance Matrix API response status:", data.status);
376}
377378const directionsResponse = await fetch(directionsUrl);
379const directionsData = await directionsResponse.json();
380393}&destination=${encodeURIComponent(destination)}&mode=transit&key=${apiKey}`;
394395const directionsResponse = await fetch(directionsUrl);
396const directionsData = await directionsResponse.json();
397409encodeURIComponent(address)
410}&key=${apiKey}`;
411const response = await fetch(geocodeUrl);
412const data = await response.json();
413
blob_adminmain.tsx2 matches
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138139export default modifyFetchHandler(passwordAuth(app.fetch));
dailySlackRoundupmain.tsx2 matches
1import { fetch } from "https://esm.town/v/std/fetch";
2import { getDayName } from "https://esm.town/v/stevekrouse/getDayName?v=2";
3import process from "node:process";
45export const dailySlackRoundup = (async () => {
6const res = await fetch(process.env.BRAINBOT_WEBHOOK_URL, {
7method: "POST",
8body: JSON.stringify({
free_open_routermain.tsx6 matches
160];
161162// Create fetch promises for each API endpoint
163const fetchPromises = apiEndpoints.map(({ url, token }) =>
164fetch(url, {
165headers: {
166"Authorization": `Bearer ${token}`,
169);
170171// Wait for all fetch promises to resolve
172const responses = await Promise.all(fetchPromises);
173174// Extract response bodies
328});
329} /*completion*/ else {
330let response = await fetch(url.toString(), init);
331// 429: preview model unavailable
332// 408: model timeout
openapi_playgroundmain.tsx2 matches
224if (load) {
225try {
226code = await (await fetch(new URL(load, "https://esm.town/v/")))
227.text();
228code = YAML.stringify(YAML.parse(code));
265}
266});
267export default app.fetch;
28});
29const start = performance.now();
30const res = await fetch(API_URL + "/v1/eval", {
31method: "POST",
32body: JSON.stringify({