c2-http 1.0.86 → 1.0.88
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/Controller.js +2 -1
- package/dist/model/Server.js +3 -4
- package/package.json +1 -1
package/dist/model/Controller.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.OpenApi = exports.HttpDispatchDownload = exports.HttpDispatchHandling = exports.Controller = void 0;
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
4
5
|
const c2_util_1 = require("c2-util");
|
|
5
6
|
const express_1 = require("express");
|
|
6
7
|
const http_status_1 = require("http-status");
|
|
@@ -55,7 +56,7 @@ exports.HttpDispatchHandling = HttpDispatchHandling;
|
|
|
55
56
|
function HttpDispatchDownload(target, methodName, descriptor) {
|
|
56
57
|
const originalMethod = descriptor.value;
|
|
57
58
|
descriptor.value = async function (...args) {
|
|
58
|
-
const [response] = args;
|
|
59
|
+
const [request, response] = args;
|
|
59
60
|
try {
|
|
60
61
|
const [status, data] = await originalMethod.apply(this, args);
|
|
61
62
|
return response.status(status).send(data);
|
package/dist/model/Server.js
CHANGED
|
@@ -22,15 +22,14 @@ class Server {
|
|
|
22
22
|
for (const router of this.config.routes) {
|
|
23
23
|
this.app.use(router);
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
this.app.use("/docs", swagger_ui_express_1.default.serve, swagger_ui_express_1.default.setup(global.OPEN_API_DOC));
|
|
26
|
+
console.log("Rotas abertas OK");
|
|
26
27
|
this.app.use(this.config.tokenCheckMiddleware);
|
|
27
28
|
for (const router of this.config.routesWithToken) {
|
|
28
29
|
// router.use(this.config.tokenCheckMiddleware)
|
|
29
30
|
this.app.use(router);
|
|
30
31
|
}
|
|
31
|
-
console.log("Rotas
|
|
32
|
-
this.app.use("/docs", swagger_ui_express_1.default.serve, swagger_ui_express_1.default.setup(global.OPEN_API_DOC));
|
|
33
|
-
console.log("Rotas swagger OK");
|
|
32
|
+
console.log("Rotas fechadas OK");
|
|
34
33
|
this.server = this.app.listen(this.config.port, async () => {
|
|
35
34
|
console.log(`Server running on port ${this.config.port}`);
|
|
36
35
|
if (callback) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "c2-http",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.88",
|
|
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>",
|