Mercurial
comparison benchmark/bun-http-framework-benchmark/src/bun/fastify.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 fastify from "fastify" | |
| 2 | |
| 3 const server = fastify() | |
| 4 .get("/", () => "Hi") | |
| 5 .get("/id/:id", (req, res) => { | |
| 6 res.header("x-powered-by", "benchmark") | |
| 7 return `${req.params.id} ${req.query.name}` | |
| 8 }) | |
| 9 .post("/json", (req, _res) => req.body) | |
| 10 | |
| 11 server.listen({ port: 3000 }, function (err) { | |
| 12 if (err) { | |
| 13 server.log.error(err) | |
| 14 process.exit(1) | |
| 15 } | |
| 16 }); |