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(
libsqlstudiomain.tsx1 match
4const app = createApp();
56export default lastlogin(app.fetch, {
7verifyEmail: (email) => email === "steve@val.town",
8});
89try {
10const response = await fetch(apiUrl);
11const data = await response.json();
1220};
21} catch (error) {
22console.error("Error fetching Wikipedia data:", error);
23return null;
24}
45const app = new Hono();
6export default valTownBadgeMiddleware(app.fetch, import.meta.url);
7app.get("/", (c) => {
8return c.html(
yellowSpidermain.tsx2 matches
1import { jsPython } from "npm:jspython-interpreter";
2const interpreter = jsPython()
3.addFunction("fetch", fetch);
4const script = `
5print(fetch("https://datasette.simonwillison.net/simonwillisonblog/blog_quotation.json?_labels=on&_shape=objects").text())
6`;
7await interpreter.evaluate(script);
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);
dateme_router_hydratedmain.tsx2 matches
10// Generic loader that forwards on requests for that page's JSON data
11function loader({ request }) {
12return fetch(request, {
13headers: {
14"Content-Type": "application/json",
20function action({ request }) {
21if (request.method === "GET") { throw Error("GET not expected here - something is wrong."); }
22return fetch(request);
23}
24
dateme_home_reactmain.tsx1 match
14async function reverseGeocodeNominat(lat, lng) {
15const url = `https://nominatim.openstreetmap.org/reverse?format=json&lat=${lat}&lon=${lng}&zoom=13`;
16const response = await fetch(url);
17const json = await response.json();
18return json;