Mercurial
comparison benchmark/bun-http-framework-benchmark/src/deno/acorn.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 { Router } from '@oak/acorn' | |
| 2 | |
| 3 const app = new Router() | |
| 4 | |
| 5 app.get('/', () => new Response('Hi')) | |
| 6 app.get('/id/:id', async (ctx) => { | |
| 7 return new Response(`${ctx.params.id} ${(await ctx.queryParams()).name}`, { | |
| 8 headers: { | |
| 9 'x-powered-by': 'benchmark' | |
| 10 } | |
| 11 }) | |
| 12 }) | |
| 13 app.post('/json', (ctx) => ctx.body()) | |
| 14 | |
| 15 app.listen({ port: 3000 }) |