@athenna/http 1.0.8 → 1.0.9

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.0.8",
3
+ "version": "1.0.9",
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,7 +159,7 @@
159
159
  },
160
160
  "dependencies": {
161
161
  "@athenna/config": "1.0.5",
162
- "@athenna/ioc": "1.0.6",
162
+ "@athenna/ioc": "1.0.7",
163
163
  "@secjs/utils": "1.8.0",
164
164
  "fastify": "3.27.4",
165
165
  "reflect-metadata": "0.1.13",
@@ -14,7 +14,7 @@ const ioc_1 = require("@athenna/ioc");
14
14
  class HttpRouteProvider extends ioc_1.ServiceProvider {
15
15
  boot() {
16
16
  const http = this.container.safeUse('Athenna/Core/HttpServer');
17
- this.container.bind('Athenna/Core/HttpRoute', new Router_1.Router(http));
17
+ this.container.instance('Athenna/Core/HttpRoute', new Router_1.Router(http));
18
18
  }
19
19
  register() { }
20
20
  }
@@ -14,7 +14,7 @@ const ioc_1 = require("@athenna/ioc");
14
14
  class HttpServerProvider extends ioc_1.ServiceProvider {
15
15
  boot() { }
16
16
  register() {
17
- this.container.singleton('Athenna/Core/HttpServer', new Http_1.Http());
17
+ this.container.instance('Athenna/Core/HttpServer', new Http_1.Http());
18
18
  }
19
19
  }
20
20
  exports.HttpServerProvider = HttpServerProvider;
@@ -47,7 +47,7 @@ class Route {
47
47
  };
48
48
  const insertionType = prepend ? 'unshift' : 'push';
49
49
  if (utils_1.Is.String(middleware)) {
50
- const mid = ioc.use(`App/Middlewares/${middleware}`);
50
+ const mid = ioc.safeUse(`App/Middlewares/${middleware}`);
51
51
  if (!mid) {
52
52
  throw new MiddlewareNotFoundException_1.MiddlewareNotFoundException(middleware);
53
53
  }
@@ -89,7 +89,7 @@ class Route {
89
89
  };
90
90
  if (utils_1.Is.String(this.handler)) {
91
91
  const [controller, method] = this.handler.split('.');
92
- const dependency = ioc.use(`App/Controllers/${controller}`);
92
+ const dependency = ioc.safeUse(`App/Controllers/${controller}`);
93
93
  if (!dependency[method]) {
94
94
  throw new UndefinedControllerMethodException_1.UndefinedControllerMethodException(method, controller);
95
95
  }