comparison benchmark/bun-http-framework-benchmark/dev/adonis/start/kernel.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 | Application middleware
4 |--------------------------------------------------------------------------
5 |
6 | This file is used to define middleware for HTTP requests. You can register
7 | middleware as a `closure` or an IoC container binding. The bindings are
8 | preferred, since they keep this file clean.
9 |
10 */
11
12 import Server from '@ioc:Adonis/Core/Server'
13
14 /*
15 |--------------------------------------------------------------------------
16 | Global middleware
17 |--------------------------------------------------------------------------
18 |
19 | An array of global middleware, that will be executed in the order they
20 | are defined for every HTTP requests.
21 |
22 */
23 Server.middleware.register([() => import('@ioc:Adonis/Core/BodyParser')])
24
25 /*
26 |--------------------------------------------------------------------------
27 | Named middleware
28 |--------------------------------------------------------------------------
29 |
30 | Named middleware are defined as key-value pair. The value is the namespace
31 | or middleware function and key is the alias. Later you can use these
32 | alias on individual routes. For example:
33 |
34 | { auth: () => import('App/Middleware/Auth') }
35 |
36 | and then use it as follows
37 |
38 | Route.get('dashboard', 'UserController.dashboard').middleware('auth')
39 |
40 */
41 Server.middleware.registerNamed({})