Mercurial
comparison benchmark/bun-http-framework-benchmark/src/node/elysia.js @ 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 const { Elysia } = require('elysia') | |
| 2 const { node } = require('@elysiajs/node') | |
| 3 | |
| 4 const app = new Elysia({ adapter: node() }) | |
| 5 .get('/', () => 'Hi') | |
| 6 .get('/id/:id', (c) => { | |
| 7 c.set.headers['x-powered-by'] = 'benchmark' | |
| 8 | |
| 9 return `${c.params.id} ${c.query.name}` | |
| 10 }) | |
| 11 .post('/json', (c) => c.body, { | |
| 12 type: 'json' | |
| 13 }) | |
| 14 .listen(3000) |