Mercurial
comparison benchmark/bun-http-framework-benchmark/src/bun/vixeny.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 { wrap } from 'vixeny' | |
| 2 | |
| 3 Bun.serve({ | |
| 4 fetch: wrap()() | |
| 5 .petitionWithoutCTX({ | |
| 6 path: '/', | |
| 7 r: () => new Response('Hi') | |
| 8 }) | |
| 9 .stdPetition({ | |
| 10 path: '/id/:id', | |
| 11 headings: { | |
| 12 // This doesn't work for some reason | |
| 13 headers: { | |
| 14 'x-powered-by': 'benchmark' | |
| 15 } | |
| 16 }, | |
| 17 param:{ | |
| 18 unique: true | |
| 19 }, | |
| 20 query: { | |
| 21 unique: true, | |
| 22 name: "name" | |
| 23 }, | |
| 24 f: (f) => f.param + ' ' + f.query | |
| 25 }) | |
| 26 .stdPetition({ | |
| 27 path: '/json', | |
| 28 method: 'POST', | |
| 29 headings: { | |
| 30 headers: { | |
| 31 'content-type': 'application/json' | |
| 32 } | |
| 33 }, | |
| 34 f: async (f) => JSON.stringify(await f.req.json()) | |
| 35 }) | |
| 36 .compose() | |
| 37 }) |