Mercurial
comparison benchmark/bun-http-framework-benchmark/src/bun/hono.ts @ 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 import { Hono } from 'hono' | |
| 2 import { RegExpRouter } from 'hono/router/reg-exp-router' | |
| 3 | |
| 4 const app = new Hono({ router: new RegExpRouter() }) | |
| 5 | |
| 6 app.get('/', (c) => c.text('Hi')) | |
| 7 .post('/json', (c) => c.req.json().then(c.json)) | |
| 8 .get('/id/:id', (c) => { | |
| 9 const id = c.req.param('id') | |
| 10 const name = c.req.query('name') | |
| 11 | |
| 12 c.header('x-powered-by', 'benchmark') | |
| 13 | |
| 14 return c.text(`${id} ${name}`) | |
| 15 }) | |
| 16 | |
| 17 export default app |