comparison benchmark/bun-http-framework-benchmark/src/deno/hono.ts @ 185:dfdd66825396

Merged in keep alive changes and mrjunejune changes.
author MrJuneJune <me@mrjunejune.com>
date Fri, 23 Jan 2026 22:22:30 -0800
parents a8976a008a9d
children
comparison
equal deleted inserted replaced
182:d6ab5921fedc 185:dfdd66825396
1 import { Hono, RegExpRouter } from 'https://deno.land/x/[email protected]/mod.ts'
2
3 const app = new Hono({ router: new RegExpRouter() })
4
5 app.get('/', (c) => c.text('Hi'))
6 .post('/json', (c) => c.req.json().then(c.json))
7 .get('/id/:id', (c) => {
8 const id = c.req.param('id')
9 const name = c.req.query('name')
10
11 c.header('x-powered-by', 'benchmark')
12
13 return c.text(`${id} ${name}`)
14 })
15
16 Deno.serve(
17 {
18 port: 3000
19 },
20 app.fetch
21 )