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));
2import { email } from "https://esm.town/v/std/email";
3import { formatAsCurrency } from "https://esm.town/v/panphora/formatAsCurrency";
4import { fetchJSON } from "https://esm.town/v/panphora/fetchJSON";
56export default async function(interval: Interval) {
7const lastBtcPrice = await blob.getJSON("lastBtcPrice") || 0;
89let btc = await fetchJSON(
10`https://rest.coinapi.io/v1/quotes/COINBASE_SPOT_BTC_USD/current`,
11{
9}
1011const response = await fetch(
12`https://maps.googleapis.com/maps/api/distancematrix/json?destinations=${destinationA}&origins=${destinationB}&units=imperial&key=${apiKey}`,
13);
1415if (!response.ok) {
16return new Response("Failed to fetch data from Google Maps API", { status: response.status });
17}
18
sillifierSlangifiermain.tsx1 match
12const updateHtml = async () => {
13try {
14const response = await fetch("/api/modify", {
15method: "POST",
16headers: { "Content-Type": "application/json" },
isMyWebsiteDownmain.tsx2 matches
14start = performance.now();
15try {
16const res = await fetch(url);
17end = performance.now();
18status = res.status;
25} catch (e) {
26end = performance.now();
27reason = `couldn't fetch: ${e}`;
28ok = false;
29console.log(`Website down (${url}): ${reason} (${end - start}ms)`);
GDI_AITranslatormain.tsx1 match
1314try {
15const response = await fetch("https://rozek-gdi_aitranslatorservice.web.val.run", {
16method: "POST",
17body: germanText,
lovableVioletLandfowlmain.tsx13 matches
10setConverting(prev => ({ ...prev, [index]: true }));
11try {
12const response = await fetch(url);
13const blob = await response.blob();
14const img = await createImageBitmap(blob);
130setHtmlContent('');
131try {
132const response = await fetch(`/api?url=${encodeURIComponent(url)}`);
133if (!response.ok) {
134throw new Error(`HTTP error! status: ${response.status}`);
141const metrics = extractPerformanceMetrics(data);
142setPerformanceMetrics(metrics);
143await fetchHtmlContent(url);
144} catch (error) {
145console.error("Error fetching results:", error);
146setResults({ error: error.message || "Failed to fetch results" });
147}
148setLoading(false);
149};
150151const fetchHtmlContent = async (url) => {
152try {
153const response = await fetch(`/html?url=${encodeURIComponent(url)}`);
154if (!response.ok) {
155throw new Error(`HTTP error! status: ${response.status}`);
158setHtmlContent(html);
159} catch (error) {
160console.error("Error fetching HTML content:", error);
161setHtmlContent("Failed to fetch HTML content");
162}
163};
331332try {
333const response = await fetch(apiUrl);
334if (!response.ok) {
335throw new Error(`HTTP error! status: ${response.status}`);
343});
344} catch (error) {
345return new Response(JSON.stringify({ error: error.message || "Failed to fetch PageSpeed Insights" }), {
346status: 500,
347headers: {
360361try {
362const response = await fetch(testUrl);
363if (!response.ok) {
364throw new Error(`HTTP error! status: ${response.status}`);
372});
373} catch (error) {
374return new Response("Failed to fetch HTML content", { status: 500 });
375}
376}
genuineGrayWrenmain.tsx1 match
187188try {
189const response = await fetch("/api/combine", {
190method: "POST",
191headers: {
418console.log(`Request body: ${body}`);
419420const response = await fetch(API_CONFIG.url, {
421...API_CONFIG,
422body: body,
432} catch (error) {
433console.error(`Error in makeApiRequest: ${error.message}`);
434throw new Error(`Failed to fetch definition from the server. Please try again. Error: ${error.message}`);
435}
436}