cronLoggermain.tsx2 matches
2import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
3import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
4import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=45";
5import { refs } from "https://esm.town/v/stevekrouse/refs?v=11";
626headers["Authorization"] = `Bearer ${token}`;
27}
28const { id } = await fetchJSON(`${API_URL}/v1/alias/${userHandle}/${valName}`, { headers });
2930const table_name = "cron_evals";
1import { normalizeURL } from "https://esm.town/v/stevekrouse/normalizeURL";
23export const fetchJSON = async (
4url: string | URL,
5options?: RequestInit & {
6bearer?: string;
7fetch?: typeof fetch;
8},
9) => {
17headers.set("traceparent", traceparent);
18}
19let fetch = options?.fetch ?? globalThis.fetch;
20let resp = await fetch(normalizeURL(url), {
21redirect: "follow",
22...options,
28}
29catch (e) {
30throw new Error(`fetchJSON error: ${e.message} in ${url}\n\n"${text}"`);
31}
32};
11const start = performance.now();
12try {
13const res = await fetch(url);
14end = performance.now();
15status = res.status;
22} catch (e) {
23end = performance.now();
24reason = `couldn't fetch: ${e}`;
25ok = false;
26console.log(`Website down (${url}): ${reason} (${end - start}ms)`);
staticChessmain.tsx2 matches
1112constructor() {}
13async fetch(req: Request): Promise<Response> {
14if (new URL(req.url).pathname === "/robots.txt") {
15return new Response("User-agent: *\nDisallow: /");
232const sc = new StaticChess();
233234export default analyticsHandlerWrapper(sc.fetch.bind(sc));
test_explorermain.tsx1 match
3export { Test } from "https://esm.town/v/pomdtr/test";
45export default router.fetch;
blobbyFacemain.tsx15 matches
2import { blobby } from "https://esm.town/v/yawnxyz/blobby";
3import { fileTypeFromBuffer } from 'npm:file-type';
4import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
5import { passwordAuth } from "https://esm.town/v/pomdtr/password_auth?v=74";
6666768// Endpoint to fetch blob by key
69app.get("/blob/:key", async (c) => {
70const key = c.req.param('key');
193this.blobs[key] = {isLoading: true};
194
195const response = await fetch('/blob/' + key);
196const contentType = response.headers.get('Content-Type');
197blob.type = contentType || 'text/plain';
223let blob = this.blobs[key];
224try {
225const response = await fetch('/create/' + key, {
226method: 'POST',
227headers: {
247248// Send a delete request to the server
249const response = await fetch('/delete/' + key, { method: 'GET' });
250251// Check the response status
313
314try {
315const response = await fetch('/upload/' + key, {
316method: 'POST',
317body: formData,
338
339try {
340const response = await fetch('/uploadUrl' + '?key=' + key + '&url=' + url);
341
342if (!response.ok) {
361if (!this.newKeyName) return;
362try {
363const response = await fetch('/rename?key='+key+'&newKey='+this.newKeyName);
364if (!response.ok) {
365throw new Error('Failed to rename blob');
526async loadBlob() {
527this.isLoading = true;
528const response = await fetch('/blob/' + this.key);
529const contentType = response.headers.get('Content-Type');
530this.blobType = contentType || 'text/plain';
550async updateCreate() {
551try {
552const response = await fetch('/create/' + this.key, {
553method: 'POST',
554headers: {
573574try {
575const response = await fetch('/upload/' + this.key, {
576method: 'POST',
577body: formData,
593if (this.uploadUrl) {
594try {
595const response = await fetch('/uploadUrl?key=' + this.key + '&url=' + this.uploadUrl);
596597if (!response.ok) {
610if (!this.newKeyName) return;
611try {
612const response = await fetch('/rename?key=' + this.key + '&newKey=' + this.newKeyName);
613if (!response.ok) {
614throw new Error('Failed to rename blob');
707708709// export default app.fetch;
710export default passwordAuth(app.fetch, {
711// password: "123", // Deno.env.get("AUTH_TEST"),
712});
counterTownmain.tsx2 matches
1/** @jsxImportSource npm:hono@3/jsx */
2import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
3import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
4import { Hono } from "npm:hono";
55051const app = new Hono();
52export default reloadOnSaveFetchMiddleware(counterTownMiddleware(app.fetch));
53app.get("/", async (c) => {
54return c.html(
blushAardwolfmain.tsx3 matches
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
23const blog_bookmark = await fetchJSON(
4"https://datasette.simonwillison.net/simonwillisonblog/blog_blogmark.json?_labels=on&_shape=objects",
5);
67const blog_quotation = await fetchJSON(
8"https://datasette.simonwillison.net/simonwillisonblog/blog_quotation.json?_labels=on&_shape=objects",
9);
fuchsiaSnipemain.tsx1 match
1export default async function(req: Request): Promise<Response> {
2const response = await fetch("http://worldtimeapi.org/api/timezone/America/New_York")
3const timeData = await response.json()
4
7} from "https://esm.sh/@imagemagick/magick-wasm";
89const resp = await fetch("https://esm.sh/@imagemagick/magick-wasm@0.0.29/dist/magick.wasm");
10const wasmBytes = await resp.arrayBuffer();
11