c2-http 1.0.36 → 1.0.37

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.
@@ -1,11 +1,36 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
2
25
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
27
  };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.Server = void 0;
7
- const express_1 = __importDefault(require("express"));
30
+ const express_1 = __importStar(require("express"));
8
31
  const i18n_1 = require("../i18n");
32
+ const swagger_ui_express_1 = __importDefault(require("swagger-ui-express"));
33
+ const Controller_1 = require("./Controller");
9
34
  class Server {
10
35
  app;
11
36
  config;
@@ -16,7 +41,7 @@ class Server {
16
41
  async initialize(callback) {
17
42
  (0, i18n_1.initializei18n)(this.config.i18n);
18
43
  console.log(`Initializing server on ${this.config.port}...`);
19
- // this.app.get("/docs", swaggerUI.serve, swaggerUI.setup(Controller.openApi))
44
+ this.app.use((0, express_1.Router)().get("/docs", swagger_ui_express_1.default.serve, swagger_ui_express_1.default.setup(Controller_1.Controller.openApi)));
20
45
  this.config.globalMiddleware(this.app);
21
46
  for (const router of this.config.routes) {
22
47
  this.app.use(router);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c2-http",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
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>",