4app.get("/", (c) => c.text("Hello from Hono!"));
5app.get("/yeah", (c) => c.text("Routing!"));
6export default app.fetch;
10
11 constructor() {}
12 async fetch(req: Request): Promise<Response> {
13 if (new URL(req.url).pathname === "/robots.txt") {
14 return new Response("User-agent: *\nDisallow: /");
224const sc = new StaticChess();
225
226export default sc.fetch.bind(sc);
4let location = "brooklyn ny";
5let lang = "en";
6const weather = await fetch(
7 `https://wttr.in/${location}?lang=${lang}&format=j1`,
8).then(r => r.json());
6
7function esmTown(url) {
8 return fetch(url, {
9 headers: {
10 "User-Agent":
15
16const app = new Hono();
17export default app.fetch;
18
19app.get("/", async (c) =>
24 const authHeader = req.headers.get("Proxy-Authorization") || req.headers.get("Authorization");
25 const token = authHeader ? parseBearerString(authHeader) : undefined;
26 const meRes = await fetch(`${API_URL}/v1/me`, { headers: { Authorization: `Bearer ${token}` } });
27 if (!meRes.ok) {
28 return new Response("Unauthorized", { status: 401 });
46 headers.set("OpenAI-Organization", Deno.env.get("OPENAI_API_ORG"));
47
48 const openAIRes = await fetch(url, {
49 method: req.method,
50 headers,
16
17import { wasmHandler } from "https://esm.town/v/maxm/tinygoHttp";
18const resp = await fetch("https://maxm-wasmblobhost.web.val.run/jpxqvyy5tphiwehzklmioklpkpz4gpzs.wasm");
19const handler = await wasmHandler(new Uint8Array(await resp.arrayBuffer()));
20export default async function(req: Request): Promise<Response> {
29 e.preventDefault();
30 setLoading(true);
31 const cron = await fetch("/compile", {
32 method: "POST",
33 body: new FormData(e.target as HTMLFormElement),
5
6const app = new Hono();
7export default app.fetch;
8app.get("/", (c) =>
9 c.html(
89 button.disabled = true;
90 button.innerText = "Loading..";
91 const cron = await fetch("/compile", { method: "POST", body: new FormData(form) }).then((r) => r.text());
92 button.disabled = false;
93 button.innerText = "Compile";
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
6
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(city: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${city}?format=j1`);
5}
6