comparison benchmark/bun-http-framework-benchmark/src/node/ultimate-express.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 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, () => {})