7Currently (as of 4/14/24) this only works for small files (< 1mb). For larger files you get an error: `{"statusCode":413,"error":"Payload Too Large","message":"request entity too large"}`.
8
9A workaround is to upload to another service client-side, send the URL from that service to your Val Town server, and then fetch the file server-side (helper: @stevekrouse/uploadTo0x0).
10
11Migrated from folder: Archive/fileInputUploadExample
1Migrated from folder: Archive/auth/signedFetch
83});
84
85export default app.fetch;
5
6const app = new Hono();
7export default app.fetch;
8app.get("/", async (c) => {
9 const description = c.req.query("description") || "On weekdays at noon";
59});
60
61export default app.fetch;
60});
61
62export default app.fetch
11How does this new shiny search engine work? Well, it's quite simple.
12
131. I wrote a [Deno script](https://github.com/pomdtr/val-town-mirror/blob/main/scripts/pull.ts) that fetches all vals from the Val Town API.
142. I pushed the data to a [Github Repository](https://github.com/pomdtr/val-town-mirror)
153. I added a [Github Action](https://github.com/pomdtr/val-town-mirror/blob/main/.github/workflows/sync.yaml) that runs the script every hour to refresh the data.
1import { API_URL } from "https://esm.town/v/std/API_URL?v=5";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=42";
3import { Octokit } from "npm:@octokit/rest";
4import { DateTime } from "npm:luxon";
127
128 try {
129 const { code } = await fetchJSON(`${API_URL}/v1/alias/${vtUser}/${valName}`, {
130 headers: { "Authorization": `Bearer ${Deno.env.get("valtown")}` },
131 });
1import { fetch } from "https://esm.town/v/std/fetch?v=5";
2
3const url = "https://atmos.washington.edu/cgi-bin/uw.cgi?20240408";
4const data = await fetch(url);
5const text = await data.text();
6console.log(text);
1This is an example call of @stevekrouse/insecureFetch
2
3Migrated from folder: Archive/blueSwordfish