comparison benchmark/bun-http-framework-benchmark/src/bun/express.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 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)