comparison benchmark/bun-http-framework-benchmark/src/node/hono.js @ 186:8cf4ec5e2191 hg-web

Fixed merge conflict.
author MrJuneJune <me@mrjunejune.com>
date Fri, 23 Jan 2026 22:38:59 -0800
parents a8976a008a9d
children
comparison
equal deleted inserted replaced
176:fed99fc04e12 186:8cf4ec5e2191
1 const { Hono } = require("hono")
2 const { serve } = require("@hono/node-server")
3 const { RegExpRouter } = require("hono/router/reg-exp-router")
4
5 const app = new Hono({ router: new RegExpRouter() })
6
7 app.get("/", (c) => c.text("Hi"))
8 .post("/json", (c) => c.req.json().then(c.json))
9 .get("/id/:id", (c) => {
10 const id = c.req.param("id")
11 const name = c.req.query("name")
12
13 c.header("x-powered-by", "benchmark")
14
15 return c.text(`${id} ${name}`)
16 })
17
18 serve(app)