Mercurial
diff benchmark/bun-http-framework-benchmark/dev/adonis/start/routes.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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/benchmark/bun-http-framework-benchmark/dev/adonis/start/routes.ts Fri Jan 23 21:19:08 2026 -0800 @@ -0,0 +1,29 @@ +/* +|-------------------------------------------------------------------------- +| Routes +|-------------------------------------------------------------------------- +| +| This file is dedicated for defining HTTP routes. A single file is enough +| for majority of projects, however you can define routes in different +| files and just make sure to import them inside this file. For example +| +| Define routes in following two files +| ├── start/routes/cart.ts +| ├── start/routes/customer.ts +| +| and then import them inside `start/routes.ts` as follows +| +| import './routes/cart' +| import './routes/customer' +| +*/ + +import Route from '@ioc:Adonis/Core/Route' + +Route.get('/', () => 'hi') +Route.get('/id/:id', ({ params, request, response }) => { + response.header('x-powered-by', 'benchmark') + + return `${params.id} ${request.qs().name}` +}) +Route.post('/json', ({ request }) => request.body())