comparison benchmark/bun-http-framework-benchmark/src/bun/oak.ts @ 183:a8976a008a9d

[BenchMark] Added bun bench mark to test seoboe vs other popular benchmarks.
author MrJuneJune <me@mrjunejune.com>
date Fri, 23 Jan 2026 21:19:08 -0800
parents
children
comparison
equal deleted inserted replaced
179:8d17f6e6e290 183:a8976a008a9d
1 import { Application, Router } from "@oakserver/oak"
2
3 const router = new Router()
4 .get("/", (context) => {
5 context.response.body = "Hi"
6 })
7 .get("/id/:id", (context) => {
8 context.response.headers.append("x-powered-by", "benchmark")
9 context.response.body = `${
10 context.params.id
11 } ${context.request.url.searchParams.get("name")}`
12 })
13 .post("/json", async (context) => {
14 context.response.body = await context.request.body.json()
15 })
16
17 const app = new Application()
18 app.use(router.routes())
19 app.use(router.allowedMethods())
20
21 await app.listen({ port: 3000 })