Mercurial
comparison benchmark/bun-http-framework-benchmark/src/bun/express.ts @ 186:8cf4ec5e2191 hg-web
Fixed merge conflict.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Fri, 23 Jan 2026 22:38:59 -0800 |
| parents | a8976a008a9d |
| children |
comparison
equal
deleted
inserted
replaced
| 176:fed99fc04e12 | 186:8cf4ec5e2191 |
|---|---|
| 1 import express from 'express' | |
| 2 | |
| 3 express() | |
| 4 .use(express.json()) | |
| 5 .get('/', (req, res) => { | |
| 6 res.setHeader('content-type', 'text/plain').send('Hi') | |
| 7 }) | |
| 8 .post('/json', ({ body }, res) => { | |
| 9 res.json(body) | |
| 10 }) | |
| 11 .get('/id/:id', ({ params: { id }, query: { name } }, res) => { | |
| 12 res.setHeader('x-powered-by', 'benchmark') | |
| 13 .setHeader('content-type', 'text/plain') | |
| 14 .send(`${id} ${name}`) | |
| 15 }) | |
| 16 .listen(3000) |