Mercurial
comparison benchmark/bun-http-framework-benchmark/src/node/ultimate-express.js @ 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 const uExpress = require('ultimate-express') | |
| 2 | |
| 3 const app = uExpress() | |
| 4 app.set("etag", false) | |
| 5 | |
| 6 app.get('/', (req, res) => { | |
| 7 res.setHeader('content-type', 'text/plain').send('Hi') | |
| 8 }) | |
| 9 | |
| 10 app.post('/json', uExpress.json(), ({ body }, res) => { | |
| 11 res.json(body) | |
| 12 }) | |
| 13 | |
| 14 app.get('/id/:id', ({ params: { id }, query: { name } }, res) => { | |
| 15 res.setHeader('x-powered-by', 'benchmark') | |
| 16 .setHeader('content-type', 'text/plain') | |
| 17 .send(`${id} ${name}`) | |
| 18 }) | |
| 19 | |
| 20 app.listen(3000, () => {}) |