c2-http 1.0.77 → 1.0.79
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/dist/model/Server.d.ts +1 -0
- package/dist/model/Server.js +5 -3
- package/package.json +1 -1
package/dist/model/Server.d.ts
CHANGED
package/dist/model/Server.js
CHANGED
|
@@ -5,11 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Server = void 0;
|
|
7
7
|
const express_1 = __importDefault(require("express"));
|
|
8
|
-
const i18n_1 = require("../i18n");
|
|
9
8
|
const swagger_ui_express_1 = __importDefault(require("swagger-ui-express"));
|
|
9
|
+
const i18n_1 = require("../i18n");
|
|
10
10
|
class Server {
|
|
11
11
|
app;
|
|
12
12
|
config;
|
|
13
|
+
server;
|
|
13
14
|
constructor(config) {
|
|
14
15
|
this.app = (0, express_1.default)();
|
|
15
16
|
this.config = config;
|
|
@@ -29,15 +30,16 @@ class Server {
|
|
|
29
30
|
console.log("Rotas TOKEN OK");
|
|
30
31
|
this.app.use("/docs", swagger_ui_express_1.default.serve, swagger_ui_express_1.default.setup(global.OPEN_API_DOC));
|
|
31
32
|
console.log("Rotas swagger OK");
|
|
32
|
-
|
|
33
|
+
this.server = this.app.listen(this.config.port, async () => {
|
|
33
34
|
console.log(`Server running on port ${this.config.port}`);
|
|
34
35
|
if (callback) {
|
|
35
36
|
await callback(this.app);
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
39
|
process.on("SIGTERM", () => {
|
|
39
|
-
server.close(() => {
|
|
40
|
+
this.server.close(() => {
|
|
40
41
|
console.log("Process terminated");
|
|
42
|
+
process.exit();
|
|
41
43
|
});
|
|
42
44
|
});
|
|
43
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c2-http",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.79",
|
|
4
4
|
"description": "Biblioteca Typescript para API NodeJS",
|
|
5
5
|
"repository": "https://cabralsilva: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@github.com/cabralsilva/c2-http.git",
|
|
6
6
|
"author": "Daniel Cabral <cabralconsultoriaemsoftware@gmail.com>",
|