jcc-express-mvc 1.6.1 → 1.6.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.
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
5
7
  Object.defineProperty(exports, "__esModule", { value: true });
6
8
  exports.Application = void 0;
7
9
  const app_root_path_1 = __importDefault(require("app-root-path"));
@@ -14,57 +16,61 @@ const dotenv_1 = __importDefault(require("dotenv"));
14
16
  const Config_1 = require("../Config/Config");
15
17
  const rootPath = app_root_path_1.default.path;
16
18
  class Application extends ExpressApplication_1.ExpressApplication {
17
- constructor() {
18
- super();
19
- this.booted = false;
20
- this.providers = [];
21
- this.rootPath = rootPath;
22
- this.configRoutes = [];
23
- this.VERSION = "0.0.0";
24
- dotenv_1.default.config({ path: `${rootPath}/.env` });
25
- this.instance("app", this);
26
- this.singleton("RouteServiceProvider", RouteServiceProvider_1.RouteServiceProvider);
19
+ constructor() {
20
+ super();
21
+ this.booted = false;
22
+ this.providers = [];
23
+ this.rootPath = rootPath;
24
+ this.configRoutes = [];
25
+ this.VERSION = "0.0.0";
26
+ dotenv_1.default.config({ path: `${rootPath}/.env` });
27
+ this.instance("app", this);
28
+ this.singleton(
29
+ "RouteServiceProvider",
30
+ RouteServiceProvider_1.RouteServiceProvider
31
+ );
32
+ }
33
+ // Register a service provider
34
+ registerProviders(Provider) {
35
+ const provider = new Provider(this);
36
+ provider.register();
37
+ this.providers.push(provider);
38
+ if (this.booted) {
39
+ this.bootProvider(provider);
27
40
  }
28
- // Register a service provider
29
- registerProviders(Provider) {
30
- const provider = new Provider(this);
31
- provider.register();
32
- this.providers.push(provider);
33
- if (this.booted) {
34
- this.bootProvider(provider);
35
- }
36
- return this;
41
+ return this;
42
+ }
43
+ // Boot all registered service providers
44
+ boot() {
45
+ if (!this.booted) {
46
+ this.providers.forEach((provider) => this.bootProvider(provider));
47
+ this.booted = true;
37
48
  }
38
- // Boot all registered service providers
39
- boot() {
40
- if (!this.booted) {
41
- this.providers.forEach((provider) => this.bootProvider(provider));
42
- this.booted = true;
43
- }
44
- return this;
45
- }
46
- // Boot a specific provider
47
- bootProvider(provider) {
48
- provider.boot();
49
- }
50
- version() {
51
- return this.VERSION;
52
- }
53
- // Start the application
54
- async run() {
55
- if (!this.booted) {
56
- this.boot();
57
- }
58
- const routeServiceProvider = this.resolve("RouteServiceProvider");
59
- //
60
- RouteBuilder_1.RouteBuilder.setServiceContainer(this);
61
- await routeServiceProvider.loadRoutes(this.configRoutes);
62
- console.log(RouteBuilder_1.RouteBuilder.routeList);
63
- const server = new Server_1.Server(this);
64
- server.server(Number(Config_1.config.get("PORT", "5500")));
65
- }
66
- static configuration() {
67
- return new ApplicationBuilder_1.ApplicationBuilder(new Application()).withConsole();
49
+ return this;
50
+ }
51
+ // Boot a specific provider
52
+ bootProvider(provider) {
53
+ provider.boot();
54
+ }
55
+ version() {
56
+ return this.VERSION;
57
+ }
58
+ // Start the application
59
+ async run() {
60
+ if (!this.booted) {
61
+ this.boot();
68
62
  }
63
+ const routeServiceProvider = this.resolve("RouteServiceProvider");
64
+ //
65
+ RouteBuilder_1.RouteBuilder.setServiceContainer(this);
66
+ await routeServiceProvider.loadRoutes(this.configRoutes);
67
+ const server = new Server_1.Server(this);
68
+ server.server(Number(Config_1.config.get("PORT", "5500")));
69
+ }
70
+ static configuration() {
71
+ return new ApplicationBuilder_1.ApplicationBuilder(
72
+ new Application()
73
+ ).withConsole();
74
+ }
69
75
  }
70
76
  exports.Application = Application;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jcc-express-mvc",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "express mvc structure",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",