1
2
3
4
5
6
7
8
9
10
11
12
13
14
const { Hono } = await import("npm:hono@3");
const app = new Hono();
app.get("/", (c) => c.text("Hono?"));
app.get("/hi", (c) => c.text("Hi!"));
app.get("/hi/:name", (c) => {
const name = c.req.param("name");
return c.text(`Hi ${capitalize(name)}`);
});
function capitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
export default app.fetch;