@adonisjs/http-server 6.8.2-7 → 6.8.2-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -13,6 +13,7 @@ import { RuntimeException } from '@poppinss/utils';
|
|
|
13
13
|
import { moduleCaller, moduleExpression, moduleImporter } from '@adonisjs/fold';
|
|
14
14
|
import { execute } from './executor.js';
|
|
15
15
|
import { dropSlash } from '../helpers.js';
|
|
16
|
+
import debug from '../debug.js';
|
|
16
17
|
/**
|
|
17
18
|
* The route class exposes the APIs for constructing a route using the
|
|
18
19
|
* fluent API.
|
|
@@ -263,8 +264,14 @@ export class Route extends Macroable {
|
|
|
263
264
|
*/
|
|
264
265
|
#getMiddlewareForStore() {
|
|
265
266
|
const middleware = new Middleware();
|
|
266
|
-
this.#routerMiddleware.forEach((one) =>
|
|
267
|
-
|
|
267
|
+
this.#routerMiddleware.forEach((one) => {
|
|
268
|
+
debug('adding global middleware to route %s, %O', this.#pattern, one);
|
|
269
|
+
middleware.add(one);
|
|
270
|
+
});
|
|
271
|
+
this.#middleware.flat().forEach((one) => {
|
|
272
|
+
debug('adding named middleware to route %s, %O', this.#pattern, one);
|
|
273
|
+
middleware.add(one);
|
|
274
|
+
});
|
|
268
275
|
return middleware;
|
|
269
276
|
}
|
|
270
277
|
/**
|
|
@@ -11,6 +11,7 @@ import matchit from '@poppinss/matchit';
|
|
|
11
11
|
import lodash from '@poppinss/utils/lodash';
|
|
12
12
|
import { RuntimeException } from '@poppinss/utils';
|
|
13
13
|
import { parseRoutePattern } from './parser.js';
|
|
14
|
+
import debug from '../debug.js';
|
|
14
15
|
/**
|
|
15
16
|
* Store class is used to store a list of routes, along side with their tokens
|
|
16
17
|
* to match the URLs.
|
|
@@ -92,6 +93,10 @@ export class RoutesStore {
|
|
|
92
93
|
if (methodRoutes.routes[route.pattern]) {
|
|
93
94
|
throw new RuntimeException(`Duplicate route found. "${method}: ${route.pattern}" route already exists`);
|
|
94
95
|
}
|
|
96
|
+
if (debug.enabled) {
|
|
97
|
+
debug('registering route to the store %O', route);
|
|
98
|
+
debug('route middleware %O', route.middleware.all().entries());
|
|
99
|
+
}
|
|
95
100
|
methodRoutes.tokens.push(tokens);
|
|
96
101
|
methodRoutes.routes[route.pattern] = route;
|
|
97
102
|
methodRoutes.routeKeys[route.pattern] =
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adonisjs/http-server",
|
|
3
|
-
"version": "6.8.2-
|
|
3
|
+
"version": "6.8.2-8",
|
|
4
4
|
"description": "AdonisJS HTTP server with support packed with Routing and Cookies",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"author": "virk,adonisjs",
|
|
44
44
|
"license": "MIT",
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@adonisjs/application": "^7.1.2-
|
|
46
|
+
"@adonisjs/application": "^7.1.2-8",
|
|
47
47
|
"@adonisjs/encryption": "^5.1.2-2",
|
|
48
48
|
"@adonisjs/eslint-config": "^1.1.7",
|
|
49
49
|
"@adonisjs/events": "^8.4.9-3",
|
|
50
|
-
"@adonisjs/fold": "^9.9.3-
|
|
50
|
+
"@adonisjs/fold": "^9.9.3-6",
|
|
51
51
|
"@adonisjs/logger": "^5.4.2-3",
|
|
52
52
|
"@adonisjs/prettier-config": "^1.1.7",
|
|
53
53
|
"@adonisjs/tsconfig": "^1.1.7",
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"@japa/api-client": "^2.0.0-0",
|
|
58
58
|
"@japa/assert": "^2.0.0-1",
|
|
59
59
|
"@japa/expect-type": "^2.0.0-0",
|
|
60
|
-
"@japa/runner": "^3.0.0-
|
|
61
|
-
"@swc/core": "^1.3.
|
|
60
|
+
"@japa/runner": "^3.0.0-5",
|
|
61
|
+
"@swc/core": "^1.3.68",
|
|
62
62
|
"@types/accepts": "^1.3.5",
|
|
63
63
|
"@types/content-disposition": "^0.5.5",
|
|
64
64
|
"@types/cookie": "^0.5.1",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"@types/fs-extra": "^11.0.1",
|
|
70
70
|
"@types/http-status-codes": "^1.2.0",
|
|
71
71
|
"@types/mime-types": "^2.1.1",
|
|
72
|
-
"@types/node": "^20.
|
|
72
|
+
"@types/node": "^20.4.1",
|
|
73
73
|
"@types/on-finished": "^2.3.1",
|
|
74
|
-
"@types/pem": "^1.
|
|
74
|
+
"@types/pem": "^1.14.0",
|
|
75
75
|
"@types/proxy-addr": "^2.0.0",
|
|
76
76
|
"@types/qs": "^6.9.7",
|
|
77
77
|
"@types/supertest": "^2.0.12",
|