@athenna/http 4.29.0 → 4.31.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.29.0",
3
+ "version": "4.31.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>",
@@ -47,13 +47,13 @@ export class RouteListCommand extends BaseCommand {
47
47
  */
48
48
  paintMethod(method) {
49
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)
50
+ GET: this.paint.purple.bold(method),
51
+ POST: this.paint.green.bold(method),
52
+ PUT: this.paint.orange.bold(method),
53
+ PATCH: this.paint.yellow.bold(method),
54
+ DELETE: this.paint.red.bold(method),
55
+ OPTIONS: this.paint.cyan.bold(method),
56
+ HEAD: this.paint.cyan.bold(method)
57
57
  };
58
58
  return colors[method];
59
59
  }
@@ -61,7 +61,7 @@ export class RouteListCommand extends BaseCommand {
61
61
  * Resolve the http routes file.
62
62
  */
63
63
  async resolveRoute() {
64
- const path = Config.get('rc.commands.route:list.route', `http.${Path.ext()}`);
64
+ const path = Config.get('rc.commands.route:list.route', Path.routes(`http.${Path.ext()}`));
65
65
  await Module.resolve(path, this.getParentURL());
66
66
  }
67
67
  /**
@@ -30,6 +30,7 @@ export class HttpExceptionHandler {
30
30
  code: String.toSnakeCase(error.code || error.name).toUpperCase(),
31
31
  name: Json.copy(error.name),
32
32
  message: Json.copy(error.message),
33
+ details: Json.copy(error.details),
33
34
  stack: Json.copy(error.stack)
34
35
  };
35
36
  if (error.help) {
@@ -42,6 +43,7 @@ export class HttpExceptionHandler {
42
43
  body.name = 'InternalServerException';
43
44
  body.message = 'An internal server exception has occurred.';
44
45
  delete body.stack;
46
+ delete body.details;
45
47
  }
46
48
  response.status(body.statusCode).send(body);
47
49
  if (!this.canBeLogged(error)) {