Mercurial
comparison benchmark/bun-http-framework-benchmark/src/bun/wobe.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 { Wobe } from 'wobe' | |
| 2 | |
| 3 new Wobe() | |
| 4 .get('/', (ctx) => ctx.res.sendText('Hi')) | |
| 5 .post('/json', async (ctx) => { | |
| 6 return ctx.res.sendJson(await ctx.request.json()) | |
| 7 }) | |
| 8 .get('/id/:id', (ctx) => { | |
| 9 ctx.res.headers.set('x-powered-by', 'benchmark') | |
| 10 | |
| 11 return ctx.res.sendText(ctx.params.id + ' ' + ctx.query.name) | |
| 12 }) | |
| 13 .listen(3000) |