@athenna/http 1.2.3 → 1.2.4

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": "1.2.3",
3
+ "version": "1.2.4",
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>",
@@ -159,8 +159,8 @@
159
159
  },
160
160
  "dependencies": {
161
161
  "@athenna/config": "1.0.8",
162
- "@athenna/ioc": "1.1.2",
163
- "@athenna/logger": "1.1.6",
162
+ "@athenna/ioc": "1.1.3",
163
+ "@athenna/logger": "1.1.7",
164
164
  "@secjs/utils": "1.8.3",
165
165
  "fastify": "3.27.4",
166
166
  "reflect-metadata": "0.1.13",
@@ -9,5 +9,5 @@
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.Route = void 0;
12
- const Handler_1 = require("../Utils/Handler");
13
- exports.Route = new Proxy({}, new Handler_1.Handler('Athenna/Core/HttpRoute'));
12
+ const ioc_1 = require("@athenna/ioc");
13
+ exports.Route = ioc_1.Facade.createFor('Athenna/Core/HttpRoute');
@@ -9,5 +9,5 @@
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.Server = void 0;
12
- const Handler_1 = require("../Utils/Handler");
13
- exports.Server = new Proxy({}, new Handler_1.Handler('Athenna/Core/HttpServer'));
12
+ const ioc_1 = require("@athenna/ioc");
13
+ exports.Server = ioc_1.Facade.createFor('Athenna/Core/HttpServer');
@@ -34,7 +34,7 @@ class HttpErrorHandler {
34
34
  delete body.stack;
35
35
  }
36
36
  if (isDebugMode) {
37
- new logger_1.Logger().error(`Error: ${JSON.stringify(body, null, 2)}`, {
37
+ logger_1.Log.error(`Error: ${JSON.stringify(body, null, 2)}`, {
38
38
  formatterConfig: {
39
39
  context: HttpErrorHandler.name,
40
40
  },
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HttpKernel = void 0;
4
- const config_1 = require("@athenna/config");
5
4
  const logger_1 = require("@athenna/logger");
5
+ const config_1 = require("@athenna/config");
6
6
  const utils_1 = require("@secjs/utils");
7
7
  const HttpErrorHandler_1 = require("../Handlers/HttpErrorHandler");
8
8
  class HttpKernel {
@@ -18,7 +18,7 @@ class HttpKernel {
18
18
  httpServer.setErrorHandler(HttpErrorHandler_1.HttpErrorHandler.handler);
19
19
  if (config_1.Config.get('http.log')) {
20
20
  httpServer.use(async (ctx) => {
21
- await new logger_1.Logger().channel('request').log(ctx);
21
+ await logger_1.Log.channel('request').log(ctx);
22
22
  return ctx.next();
23
23
  }, 'terminate');
24
24
  }
@@ -1,13 +0,0 @@
1
- /**
2
- * @athenna/http
3
- *
4
- * (c) João Lenon <lenon@athenna.io>
5
- *
6
- * For the full copyright and license information, please view the LICENSE
7
- * file that was distributed with this source code.
8
- */
9
- export declare class Handler {
10
- private readonly alias;
11
- constructor(alias: any);
12
- get(_object: any, key: string): any;
13
- }
@@ -1,24 +0,0 @@
1
- "use strict";
2
- /**
3
- * @athenna/http
4
- *
5
- * (c) João Lenon <lenon@athenna.io>
6
- *
7
- * For the full copyright and license information, please view the LICENSE
8
- * file that was distributed with this source code.
9
- */
10
- Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.Handler = void 0;
12
- class Handler {
13
- constructor(alias) {
14
- this.alias = alias;
15
- }
16
- get(_object, key) {
17
- const provider = ioc.use(this.alias);
18
- if (!provider) {
19
- return () => { };
20
- }
21
- return provider[key];
22
- }
23
- }
24
- exports.Handler = Handler;