@venok/http 2.0.1 → 2.1.0-next.1

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.
@@ -44,13 +44,7 @@ class HttpStarterModule {
44
44
  this.container = container;
45
45
  this.httpConfig = httpConfig;
46
46
  }
47
- async onModuleInit() {
48
- this.adapter = this.httpConfig.getHttpAdapterRef();
49
- this.adapter[VENOK_ADAPTER_SET_EXCEPTION_FILTER](this.container, new ApplicationConfig);
50
- this.options.callback && this.options.callback(this.httpConfig);
51
- await this.middlewareService.explore(HttpMiddlewareModule);
52
- await this.middlewareService.build();
53
- this.httpExplorerService.explore(Controller.KEY).forEach((item) => this.registerRoutes(item));
47
+ async onApplicationBootstrap() {
54
48
  const routes = this.adapter[VENOK_ADAPTER_BUILD]();
55
49
  this.adapter[VENOK_APPLY_ROUTES_TO_INSTANCE](routes);
56
50
  this.adapter.registerNotFoundHandler();
@@ -62,6 +56,14 @@ class HttpStarterModule {
62
56
  };
63
57
  await this.adapter.listen(this.options.port, this.options.hostname || "", listenCallback);
64
58
  }
59
+ async onModuleInit() {
60
+ this.adapter = this.httpConfig.getHttpAdapterRef();
61
+ this.adapter[VENOK_ADAPTER_SET_EXCEPTION_FILTER](this.container, new ApplicationConfig);
62
+ this.options.callback && this.options.callback(this.httpConfig);
63
+ await this.middlewareService.explore(HttpMiddlewareModule);
64
+ await this.middlewareService.build();
65
+ this.httpExplorerService.explore(Controller.KEY).forEach((item) => this.registerRoutes(item));
66
+ }
65
67
  registerRoutes(controllerDiscovery) {
66
68
  controllerDiscovery.getItems().forEach((item) => {
67
69
  const { path, ...metadata } = item.getMeta();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venok/http",
3
- "version": "2.0.1",
3
+ "version": "2.1.0-next.1",
4
4
  "description": "",
5
5
  "author": "shiz-ceo",
6
6
  "homepage": "",
@@ -35,8 +35,8 @@
35
35
  "test": "bun test ./test/"
36
36
  },
37
37
  "peerDependencies": {
38
- "@venok/core": "1.1.0",
39
- "@venok/integration": "1.1.0",
38
+ "@venok/core": "2.0.1",
39
+ "@venok/integration": "2.0.1",
40
40
  "reflect-metadata": "^0.2.2",
41
41
  "rxjs": "^7.8.1"
42
42
  },