Mercurial
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 179:8d17f6e6e290 | 183:a8976a008a9d |
|---|---|
| 1 /* | |
| 2 |-------------------------------------------------------------------------- | |
| 3 | Routes | |
| 4 |-------------------------------------------------------------------------- | |
| 5 | | |
| 6 | This file is dedicated for defining HTTP routes. A single file is enough | |
| 7 | for majority of projects, however you can define routes in different | |
| 8 | files and just make sure to import them inside this file. For example | |
| 9 | | |
| 10 | Define routes in following two files | |
| 11 | ├── start/routes/cart.ts | |
| 12 | ├── start/routes/customer.ts | |
| 13 | | |
| 14 | and then import them inside `start/routes.ts` as follows | |
| 15 | | |
| 16 | import './routes/cart' | |
| 17 | import './routes/customer' | |
| 18 | | |
| 19 */ | |
| 20 | |
| 21 import Route from '@ioc:Adonis/Core/Route' | |
| 22 | |
| 23 Route.get('/', () => 'hi') | |
| 24 Route.get('/id/:id', ({ params, request, response }) => { | |
| 25 response.header('x-powered-by', 'benchmark') | |
| 26 | |
| 27 return `${params.id} ${request.qs().name}` | |
| 28 }) | |
| 29 Route.post('/json', ({ request }) => request.body()) |