@athenna/http 4.27.0 → 4.29.0
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@athenna/http",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.29.0",
|
|
4
4
|
"description": "The Athenna Http server. Built on top of fastify.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "João Lenon <lenon@athenna.io>",
|
|
@@ -73,14 +73,14 @@
|
|
|
73
73
|
"#tests": "./tests/index.js"
|
|
74
74
|
},
|
|
75
75
|
"devDependencies": {
|
|
76
|
-
"@athenna/artisan": "^4.
|
|
77
|
-
"@athenna/common": "^4.
|
|
78
|
-
"@athenna/config": "^4.
|
|
79
|
-
"@athenna/ioc": "^4.
|
|
80
|
-
"@athenna/logger": "^4.
|
|
76
|
+
"@athenna/artisan": "^4.41.0",
|
|
77
|
+
"@athenna/common": "^4.36.0",
|
|
78
|
+
"@athenna/config": "^4.20.0",
|
|
79
|
+
"@athenna/ioc": "^4.19.0",
|
|
80
|
+
"@athenna/logger": "^4.19.0",
|
|
81
81
|
"@athenna/test": "^4.22.0",
|
|
82
82
|
"@athenna/tsconfig": "^4.12.0",
|
|
83
|
-
"@athenna/view": "^4.
|
|
83
|
+
"@athenna/view": "^4.21.0",
|
|
84
84
|
"@fastify/cors": "^8.4.2",
|
|
85
85
|
"@fastify/helmet": "^11.1.1",
|
|
86
86
|
"@fastify/rate-limit": "^8.1.1",
|
|
@@ -11,6 +11,10 @@ export declare class RouteListCommand extends BaseCommand {
|
|
|
11
11
|
static signature(): string;
|
|
12
12
|
static description(): string;
|
|
13
13
|
handle(): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Paint a method by its name.
|
|
16
|
+
*/
|
|
17
|
+
private paintMethod;
|
|
14
18
|
/**
|
|
15
19
|
* Resolve the http routes file.
|
|
16
20
|
*/
|
|
@@ -34,7 +34,7 @@ export class RouteListCommand extends BaseCommand {
|
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
table.row([
|
|
37
|
-
route.methods.join('|'),
|
|
37
|
+
route.methods.map(m => this.paintMethod(m)).join('|'),
|
|
38
38
|
route.url,
|
|
39
39
|
route.name || 'Not found',
|
|
40
40
|
route.handler.name || 'closure'
|
|
@@ -42,11 +42,27 @@ export class RouteListCommand extends BaseCommand {
|
|
|
42
42
|
});
|
|
43
43
|
table.render();
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Paint a method by its name.
|
|
47
|
+
*/
|
|
48
|
+
paintMethod(method) {
|
|
49
|
+
const colors = {
|
|
50
|
+
GET: this.paint.GET.bold(method),
|
|
51
|
+
POST: this.paint.POST.bold(method),
|
|
52
|
+
PUT: this.paint.PUT.bold(method),
|
|
53
|
+
PATCH: this.paint.PATCH.bold(method),
|
|
54
|
+
DELETE: this.paint.DELETE.bold(method),
|
|
55
|
+
OPTIONS: this.paint.OPTIONS.bold(method),
|
|
56
|
+
HEAD: this.paint.HEAD.bold(method)
|
|
57
|
+
};
|
|
58
|
+
return colors[method];
|
|
59
|
+
}
|
|
45
60
|
/**
|
|
46
61
|
* Resolve the http routes file.
|
|
47
62
|
*/
|
|
48
63
|
async resolveRoute() {
|
|
49
|
-
|
|
64
|
+
const path = Config.get('rc.commands.route:list.route', `http.${Path.ext()}`);
|
|
65
|
+
await Module.resolve(path, this.getParentURL());
|
|
50
66
|
}
|
|
51
67
|
/**
|
|
52
68
|
* Get the http kernel module from RC file or resolve the default one.
|