@atlantjs/backend 11.0.16 → 11.0.17

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": "@atlantjs/backend",
3
- "version": "11.0.16",
3
+ "version": "11.0.17",
4
4
  "main": "index.js",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
package/setup/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Newable } from "@atlantjs/arch";
2
2
  import { DatabaseConfigAbstract, DatabaseHelperAbstract, DatabaseLiteConfigAbstract } from "@atlantjs/database";
3
+ import express from "express";
3
4
  import { interfaces } from "inversify";
4
5
  interface ServerProps {
5
6
  databases?: Array<{
@@ -8,6 +9,6 @@ interface ServerProps {
8
9
  configs: Newable<DatabaseConfigAbstract | DatabaseLiteConfigAbstract>;
9
10
  }>;
10
11
  }
11
- export declare function initialize(props: ServerProps): void;
12
+ export declare function initialize(props: ServerProps): Promise<express.Application> | undefined;
12
13
  export declare function synthesizePaths(): void;
13
14
  export {};
package/setup/index.js CHANGED
@@ -24,7 +24,7 @@ function initialize(props) {
24
24
  const tasks = new listr2_1.Listr([
25
25
  {
26
26
  title: "Loading modules...",
27
- task: (ctx, task) => {
27
+ task: (_ctx, task) => {
28
28
  for (const module of verses_1.LOAD_MODULES) {
29
29
  require(`#/modules/${module}`);
30
30
  }
@@ -43,17 +43,18 @@ function initialize(props) {
43
43
  }),
44
44
  ]);
45
45
  }
46
- server_1.Server.initialize();
47
46
  task.title = `Server started on port \x1b[1m${verses_1.APP_PORT}\x1b`;
47
+ ctx.server = server_1.Server.initialize();
48
48
  },
49
49
  },
50
50
  ]);
51
51
  try {
52
- tasks.run();
52
+ return tasks.run().then((ctx) => ctx.server);
53
53
  }
54
54
  catch (error) {
55
55
  signale_1.default.error(`${error}`);
56
56
  }
57
+ return;
57
58
  }
58
59
  function synthesizePaths() {
59
60
  const moduleAlias = require("module-alias");
@@ -1,5 +1,6 @@
1
+ import express from "express";
1
2
  export declare class Server {
2
3
  static readonly instance: import("express-serve-static-core").Express;
3
4
  private static readonly routingOptions;
4
- static initialize(): void;
5
+ static initialize(): express.Application;
5
6
  }
@@ -23,6 +23,7 @@ class Server {
23
23
  Server.instance.use(default_error_handler_theta_1.DefaultErrorHandlerTheta.create());
24
24
  (0, routing_controllers_1.useExpressServer)(Server.instance, Server.routingOptions);
25
25
  Server.instance.listen(verses_1.APP_PORT);
26
+ return Server.instance;
26
27
  }
27
28
  }
28
29
  exports.Server = Server;