web_api_base 1.3.0 → 1.3.2

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.
@@ -6,5 +6,6 @@ export default abstract class Application implements IApplication {
6
6
  Express: Express;
7
7
  constructor();
8
8
  StartAsync(): Promise<void>;
9
+ UseCors(): void;
9
10
  abstract Configure(appConfig: IApplicationConfiguration): void;
10
11
  }
@@ -22,12 +22,16 @@ class Application {
22
22
  StartAsync() {
23
23
  return __awaiter(this, void 0, void 0, function* () {
24
24
  yield this.ApplicationConfiguration.StartAsync();
25
+ this.Express.use(express_1.default.json({ limit: 50 * 1024 * 1024 }));
25
26
  this.Configure(this.ApplicationConfiguration);
26
27
  this.Express.listen(this.ApplicationConfiguration.Port, this.ApplicationConfiguration.Host, () => {
27
28
  console.log(`App running on ${this.ApplicationConfiguration.Host}:${this.ApplicationConfiguration.Port}`);
28
29
  });
29
30
  });
30
31
  }
32
+ UseCors() {
33
+ this.Express.use(require('cors')());
34
+ }
31
35
  }
32
36
  exports.default = Application;
33
37
  //# sourceMappingURL=Application.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Application.js","sourceRoot":"","sources":["../Application.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,sDAAoC;AACpC,0FAAiE;AAIjE,MAA8B,WAAW;IAQrC;QAEI,IAAI,CAAC,wBAAwB,GAAG,IAAI,kCAAwB,EAAE,CAAC;QAE/D,IAAI,CAAC,OAAO,GAAG,IAAA,iBAAa,GAAE,CAAC;IAEnC,CAAC;IAGY,UAAU;;YAEnB,MAAM,IAAI,CAAC,wBAAwB,CAAC,UAAU,EAAE,CAAC;YAEjD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;YAE9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,GAAE,EAAE;gBAE5F,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,wBAAwB,CAAC,IAAI,IAAI,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9G,CAAC,CAAC,CAAA;QACN,CAAC;KAAA;CAKJ;AAhCD,8BAgCC"}
1
+ {"version":3,"file":"Application.js","sourceRoot":"","sources":["../Application.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,sDAAoC;AACpC,0FAAiE;AAIjE,MAA8B,WAAW;IAQrC;QAEI,IAAI,CAAC,wBAAwB,GAAG,IAAI,kCAAwB,EAAE,CAAC;QAE/D,IAAI,CAAC,OAAO,GAAG,IAAA,iBAAa,GAAE,CAAC;IAEnC,CAAC;IAGY,UAAU;;YAEnB,MAAM,IAAI,CAAC,wBAAwB,CAAC,UAAU,EAAE,CAAC;YAEjD,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAa,CAAC,IAAI,CAAC,EAAC,KAAK,EAAG,EAAE,GAAG,IAAI,GAAG,IAAI,EAAC,CAAC,CAAC,CAAC;YAEjE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;YAE9C,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,GAAE,EAAE;gBAE5F,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,CAAC,wBAAwB,CAAC,IAAI,IAAI,IAAI,CAAC,wBAAwB,CAAC,IAAI,EAAE,CAAC,CAAC;YAC9G,CAAC,CAAC,CAAA;QACN,CAAC;KAAA;IAEM,OAAO;QAEV,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;CAMJ;AAxCD,8BAwCC"}
package/dist/Index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DependecyService = exports.ControllerBase = exports.ControllersDecorators = exports.ApplicationConfiguration = exports.Application = void 0;
6
+ exports.DependecyService = exports.HTTPVerbs = exports.ControllerBase = exports.ControllersDecorators = exports.ApplicationConfiguration = exports.Application = void 0;
7
7
  var Application_1 = require("./Application");
8
8
  Object.defineProperty(exports, "Application", { enumerable: true, get: function () { return __importDefault(Application_1).default; } });
9
9
  var ApplicationConfiguration_1 = require("./ApplicationConfiguration");
@@ -12,6 +12,8 @@ var ControllerDecorators_1 = require("./decorators/controllers/ControllerDecorat
12
12
  Object.defineProperty(exports, "ControllersDecorators", { enumerable: true, get: function () { return __importDefault(ControllerDecorators_1).default; } });
13
13
  var ControllerBase_1 = require("./controllers/base/ControllerBase");
14
14
  Object.defineProperty(exports, "ControllerBase", { enumerable: true, get: function () { return ControllerBase_1.ControllerBase; } });
15
+ var HttpVerbs_1 = require("./enums/httpVerbs/HttpVerbs");
16
+ Object.defineProperty(exports, "HTTPVerbs", { enumerable: true, get: function () { return HttpVerbs_1.HTTPVerbs; } });
15
17
  var DependecyService_1 = require("./dependencyInjection/DependecyService");
16
18
  Object.defineProperty(exports, "DependecyService", { enumerable: true, get: function () { return __importDefault(DependecyService_1).default; } });
17
19
  //# sourceMappingURL=index.js.map
package/dist/Index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAsD;AAA7C,2HAAA,OAAO,OAAe;AAC/B,uEAAiF;AAAxE,qJAAA,OAAO,OAA4B;AAC5C,sFAAiG;AAAxF,8IAAA,OAAO,OAAyB;AACzC,oEAAmE;AAA1D,gHAAA,cAAc,OAAA;AACvB,2EAAqF;AAA5E,qIAAA,OAAO,OAAoB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAsD;AAA7C,2HAAA,OAAO,OAAe;AAC/B,uEAAiF;AAAxE,qJAAA,OAAO,OAA4B;AAE5C,sFAAiG;AAAxF,8IAAA,OAAO,OAAyB;AACzC,oEAAmE;AAA1D,gHAAA,cAAc,OAAA;AAEvB,yDAAwD;AAA/C,sGAAA,SAAS,OAAA;AAElB,2EAAqF;AAA5E,qIAAA,OAAO,OAAoB"}
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { default as Application } from "./Application";
2
2
  export { default as ApplicationConfiguration } from "./ApplicationConfiguration";
3
3
  export { default as ControllersDecorators } from "./decorators/controllers/ControllerDecorators";
4
4
  export { ControllerBase } from "./controllers/base/ControllerBase";
5
+ export { HTTPVerbs } from './enums/httpVerbs/HttpVerbs';
5
6
  export { default as DependecyService } from "./dependencyInjection/DependecyService";
6
7
  export { default as IMidleware } from './midlewares/IMidleware';
7
8
  export { default as IApplicationConfiguration } from "./interfaces/IApplicationConfiguration";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web_api_base",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "web api base",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",