Public
HTTP (deprecated)
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Readme

Hono

Here's an example using the Hono server library with the Web API. It works great!

Server examples

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// src/index.ts
import { Hono } from "npm:hono@3";
const app = new Hono();
app.get("/", (c) => c.text("Hello Lagon!"));
app.get("/test", (c) => c.text("Hello Lagon test!"));
app.post("/test", (c) => c.text("Hello Lagon test ppost!"));
export const handler = app.fetch;
// export const honoExample = async (req: Request) => {
// const { Hono } = await import("npm:hono@3");
// const app = new Hono();
// app.get("/", (c) => c.text("Hono?"));
// app.get("/yeah", (c) => c.text("Routing!"));
// return app.fetch(req);
// };
maxjoygit-handler.web.val.run
November 9, 2023