@tsed/platform-express 6.89.0 → 6.92.1

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,13 +1,14 @@
1
- import { PlatformBuilder, PlatformHandler, PlatformRequest, PlatformResponse, PlatformRouter } from "@tsed/common";
2
- import { Type } from "@tsed/core";
3
1
  import Express from "express";
2
+ import { PlatformAdapter, PlatformBuilder, PlatformHandler, PlatformRequest, PlatformResponse, PlatformRouter } from "@tsed/common";
3
+ import { Type } from "@tsed/core";
4
4
  import { PlatformExpressHandler, PlatformExpressRequest, PlatformExpressResponse, PlatformExpressRouter } from "../services";
5
5
  /**
6
6
  * @platform
7
7
  * @express
8
8
  */
9
- export declare class PlatformExpress extends PlatformBuilder<Express.Application, Express.Router> {
10
- static providers: ({
9
+ export declare class PlatformExpress implements PlatformAdapter<Express.Application, Express.Router> {
10
+ private platform;
11
+ readonly providers: ({
11
12
  provide: typeof PlatformRouter;
12
13
  useClass: typeof PlatformExpressRouter;
13
14
  } | {
@@ -20,20 +21,22 @@ export declare class PlatformExpress extends PlatformBuilder<Express.Application
20
21
  provide: typeof PlatformRequest;
21
22
  useClass: typeof PlatformExpressRequest;
22
23
  })[];
24
+ constructor(platform: PlatformBuilder<Express.Application, Express.Router>);
23
25
  /**
24
26
  * Create new serverless application. In this mode, the component scan are disabled.
25
27
  * @param module
26
28
  * @param settings
27
29
  */
28
- static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformExpress;
30
+ static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformBuilder<Express.Application, Express.Router>;
29
31
  /**
30
32
  * Bootstrap a server application
31
33
  * @param module
32
34
  * @param settings
33
35
  */
34
- static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformExpress>;
35
- protected useRouter(): this;
36
- protected useContext(): this;
37
- protected loadRoutes(): Promise<void>;
36
+ static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformBuilder<Express.Application, Express.Router>>;
37
+ useRouter(): this;
38
+ beforeLoadRoutes(): Promise<void>;
39
+ afterLoadRoutes(): Promise<void>;
40
+ useContext(): this;
38
41
  private configureViewsEngine;
39
42
  }
@@ -28,18 +28,41 @@ const services_1 = require("../services");
28
28
  * @platform
29
29
  * @express
30
30
  */
31
- class PlatformExpress extends common_1.PlatformBuilder {
31
+ class PlatformExpress {
32
+ constructor(platform) {
33
+ this.platform = platform;
34
+ this.providers = [
35
+ {
36
+ provide: common_1.PlatformApplication,
37
+ useClass: services_1.PlatformExpressApplication
38
+ },
39
+ {
40
+ provide: common_1.PlatformRouter,
41
+ useClass: services_1.PlatformExpressRouter
42
+ },
43
+ {
44
+ provide: common_1.PlatformHandler,
45
+ useClass: services_1.PlatformExpressHandler
46
+ },
47
+ {
48
+ provide: common_1.PlatformResponse,
49
+ useClass: services_1.PlatformExpressResponse
50
+ },
51
+ {
52
+ provide: common_1.PlatformRequest,
53
+ useClass: services_1.PlatformExpressRequest
54
+ }
55
+ ];
56
+ }
32
57
  /**
33
58
  * Create new serverless application. In this mode, the component scan are disabled.
34
59
  * @param module
35
60
  * @param settings
36
61
  */
37
62
  static create(module, settings = {}) {
38
- return this.build(PlatformExpress, module, {
39
- httpsPort: false,
40
- httpPort: false,
63
+ return common_1.PlatformBuilder.create(module, {
41
64
  ...settings,
42
- disableComponentsScan: true
65
+ adapter: PlatformExpress
43
66
  });
44
67
  }
45
68
  /**
@@ -48,56 +71,65 @@ class PlatformExpress extends common_1.PlatformBuilder {
48
71
  * @param settings
49
72
  */
50
73
  static async bootstrap(module, settings = {}) {
51
- return this.build(PlatformExpress, module, settings).bootstrap();
74
+ return common_1.PlatformBuilder.bootstrap(module, {
75
+ ...settings,
76
+ adapter: PlatformExpress
77
+ });
52
78
  }
53
79
  useRouter() {
54
- this.logger.debug("Mount app router");
55
- this.app.getApp().use(rawBodyMiddleware_1.rawBodyMiddleware);
56
- this.app.getApp().use(this.app.getRouter());
57
- return this;
58
- }
59
- useContext() {
60
- this.logger.debug("Mount app context");
61
- const invoke = (0, common_1.createContext)(this.injector);
62
- this.app.getApp().use(async (request, response, next) => {
63
- await invoke({ request, response });
64
- return next();
65
- });
80
+ const { logger, app } = this.platform;
81
+ logger.debug("Mount app router");
82
+ app.getApp().use(rawBodyMiddleware_1.rawBodyMiddleware);
83
+ app.getApp().use(app.getRouter());
66
84
  return this;
67
85
  }
68
- async loadRoutes() {
86
+ async beforeLoadRoutes() {
87
+ const { injector, app } = this.platform;
69
88
  // disable x-powered-by header
70
- this.injector.settings.get("env") === core_1.Env.PROD && this.app.getApp().disable("x-powered-by");
89
+ injector.settings.get("env") === core_1.Env.PROD && app.getApp().disable("x-powered-by");
71
90
  await this.configureViewsEngine();
72
- await super.loadRoutes();
91
+ }
92
+ async afterLoadRoutes() {
93
+ const { injector, app } = this.platform;
73
94
  // NOT FOUND
74
- this.app.use((req, res, next) => {
95
+ app.use((req, res, next) => {
75
96
  var _a;
76
- !res.headersSent && ((_a = this.injector.get(common_1.PlatformExceptions)) === null || _a === void 0 ? void 0 : _a.resourceNotFound(req.$ctx));
97
+ !res.headersSent && ((_a = injector.get(common_1.PlatformExceptions)) === null || _a === void 0 ? void 0 : _a.resourceNotFound(req.$ctx));
77
98
  });
78
99
  // EXCEPTION FILTERS
79
- this.app.use((err, req, res, next) => {
100
+ app.use((err, req, res, next) => {
80
101
  var _a;
81
- !res.headersSent && ((_a = this.injector.get(common_1.PlatformExceptions)) === null || _a === void 0 ? void 0 : _a.catch(err, req.$ctx));
102
+ !res.headersSent && ((_a = injector.get(common_1.PlatformExceptions)) === null || _a === void 0 ? void 0 : _a.catch(err, req.$ctx));
82
103
  });
83
104
  }
105
+ useContext() {
106
+ const { logger, app, injector } = this.platform;
107
+ logger.debug("Mount app context");
108
+ const invoke = (0, common_1.createContext)(injector);
109
+ app.getApp().use(async (request, response, next) => {
110
+ await invoke({ request, response });
111
+ return next();
112
+ });
113
+ return this;
114
+ }
84
115
  async configureViewsEngine() {
116
+ const { settings, injector, app } = this.platform;
85
117
  try {
86
- const { exists, disabled } = this.settings.get("views") || {};
118
+ const { exists, disabled } = settings.get("views") || {};
87
119
  if (exists && !disabled) {
88
120
  const { PlatformViews } = await Promise.resolve().then(() => __importStar(require("@tsed/platform-views")));
89
- const platformViews = this.injector.get(PlatformViews);
90
- const app = this.app.getApp();
121
+ const platformViews = injector.get(PlatformViews);
122
+ const express = app.getApp();
91
123
  platformViews.getEngines().forEach(({ extension, engine }) => {
92
- app.engine(extension, engine.render);
124
+ express.engine(extension, engine.render);
93
125
  });
94
- platformViews.viewEngine && this.app.getApp().set("view engine", platformViews.viewEngine);
95
- platformViews.root && this.app.getApp().set("views", platformViews.root);
126
+ platformViews.viewEngine && express.set("view engine", platformViews.viewEngine);
127
+ platformViews.root && express.set("views", platformViews.root);
96
128
  }
97
129
  }
98
130
  catch (error) {
99
131
  // istanbul ignore next
100
- this.injector.logger.warn({
132
+ injector.logger.warn({
101
133
  event: "PLATFORM_VIEWS_ERROR",
102
134
  message: "Unable to configure the PlatformViews service on your environment.",
103
135
  error
@@ -106,26 +138,4 @@ class PlatformExpress extends common_1.PlatformBuilder {
106
138
  }
107
139
  }
108
140
  exports.PlatformExpress = PlatformExpress;
109
- PlatformExpress.providers = [
110
- {
111
- provide: common_1.PlatformApplication,
112
- useClass: services_1.PlatformExpressApplication
113
- },
114
- {
115
- provide: common_1.PlatformRouter,
116
- useClass: services_1.PlatformExpressRouter
117
- },
118
- {
119
- provide: common_1.PlatformHandler,
120
- useClass: services_1.PlatformExpressHandler
121
- },
122
- {
123
- provide: common_1.PlatformResponse,
124
- useClass: services_1.PlatformExpressResponse
125
- },
126
- {
127
- provide: common_1.PlatformRequest,
128
- useClass: services_1.PlatformExpressRequest
129
- }
130
- ];
131
141
  //# sourceMappingURL=PlatformExpress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformExpress.js","sourceRoot":"","sources":["../../../src/components/PlatformExpress.ts"],"names":[],"mappings":";;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atformExceptions,\n PlatformHandler,\n PlatformRequest,\n PlatformResponse,\n PlatformRouter\n} from \"@tsed/common\";\nimport {Env, Type} from \"@tsed/core\";\nimport Express from \"express\";\nimport {rawBodyMiddleware} from \"../middlewares/rawBodyMiddleware\";\nimport {\n PlatformExpressApplication,\n PlatformExpressHandler,\n PlatformExpressRequest,\n PlatformExpressResponse,\n PlatformExpressRouter\n} from \"../services\";\nimport type {PlatformViews} from \"@tsed/platform-views\";\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpress extends PlatformBuilder<Express.Application, Express.Router> {\n static providers = [\n {\n provide: PlatformApplication,\n useClass: PlatformExpressApplication\n },\n {\n provide: PlatformRouter,\n useClass: PlatformExpressRouter\n },\n {\n provide: PlatformHandler,\n useClass: PlatformExpressHandler\n },\n {\n provide: PlatformResponse,\n useClass: PlatformExpressResponse\n },\n {\n provide: PlatformRequest,\n useClass: PlatformExpressRequest\n }\n ];\n\n /**\n * Create new serverless application. In this mode, the component scan are disabled.\n * @param module\n * @param settings\n */\n static create(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return this.build<PlatformExpress>(PlatformExpress, module, {\n httpsPort: false,\n httpPort: false,\n ...settings,\n disableComponentsScan: true\n });\n }\n\n /**\n * Bootstrap a server application\n * @param module\n * @param settings\n */\n static async bootstrap(module: Type<any>, settings: Partial<TsED.Configuration> = {}): Promise<PlatformExpress> {\n return this.build<PlatformExpress>(PlatformExpress, module, settings).bootstrap();\n }\n\n protected useRouter(): this {\n this.logger.debug(\"Mount app router\");\n this.app.getApp().use(rawBodyMiddleware);\n this.app.getApp().use(this.app.getRouter());\n\n return this;\n }\n\n protected useContext(): this {\n this.logger.debug(\"Mount app context\");\n\n const invoke = createContext(this.injector);\n\n this.app.getApp().use(async (request: any, response: any, next: any) => {\n await invoke({request, response});\n\n return next();\n });\n\n return this;\n }\n\n protected async loadRoutes(): Promise<void> {\n // disable x-powered-by header\n this.injector.settings.get(\"env\") === Env.PROD && this.app.getApp().disable(\"x-powered-by\");\n\n await this.configureViewsEngine();\n\n await super.loadRoutes();\n\n // NOT FOUND\n this.app.use((req: any, res: any, next: any) => {\n !res.headersSent && this.injector.get<PlatformExceptions>(PlatformExceptions)?.resourceNotFound(req.$ctx);\n });\n\n // EXCEPTION FILTERS\n this.app.use((err: any, req: any, res: any, next: any) => {\n !res.headersSent && this.injector.get<PlatformExceptions>(PlatformExceptions)?.catch(err, req.$ctx);\n });\n }\n\n private async configureViewsEngine() {\n try {\n const {exists, disabled} = this.settings.get(\"views\") || {};\n\n if (exists && !disabled) {\n const {PlatformViews} = await import(\"@tsed/platform-views\");\n const platformViews = this.injector.get<PlatformViews>(PlatformViews)!;\n const app = this.app.getApp();\n\n platformViews.getEngines().forEach(({extension, engine}) => {\n app.engine(extension, engine.render);\n });\n\n platformViews.viewEngine && this.app.getApp().set(\"view engine\", platformViews.viewEngine);\n platformViews.root && this.app.getApp().set(\"views\", platformViews.root);\n }\n } catch (error) {\n // istanbul ignore next\n this.injector.logger.warn({\n event: \"PLATFORM_VIEWS_ERROR\",\n message: \"Unable to configure the PlatformViews service on your environment.\",\n error\n });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"PlatformExpress.js","sourceRoot":"","sources":["../../../src/components/PlatformExpress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,yCAUsB;AACtB,qCAAqC;AACrC,wEAAmE;AACnE,0CAMqB;AAErB;;;GAGG;AACH,MAAa,eAAe;IAwB1B,YAAoB,QAA8D;QAA9D,aAAQ,GAAR,QAAQ,CAAsD;QAvBzE,cAAS,GAAG;YACnB;gBACE,OAAO,EAAE,4BAAmB;gBAC5B,QAAQ,EAAE,qCAA0B;aACrC;YACD;gBACE,OAAO,EAAE,uBAAc;gBACvB,QAAQ,EAAE,gCAAqB;aAChC;YACD;gBACE,OAAO,EAAE,wBAAe;gBACxB,QAAQ,EAAE,iCAAsB;aACjC;YACD;gBACE,OAAO,EAAE,yBAAgB;gBACzB,QAAQ,EAA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C,OAAO,CAAC,IAAI,EAAE,CAAC;YAEvD,IAAI,MAAM,IAAI,CAAC,QAAQ,EAAE;gBACvB,MAAM,EAAC,aAAa,EAAC,GAAG,wDAAa,sBAAsB,GAAC,CAAC;gBAC7D,MAAM,aAAa,GAAG,QAAQ,CAAC,GAAG,CAAgB,aAAa,CAAE,CAAC;gBAClE,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;gBAE7B,aAAa,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,EAAC,SAAS,EAAE,MAAM,EAAC,EAAE,EAAE;oBACzD,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC3C,CAAC,CAAC,CAAC;gBAEH,aAAa,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;gBACjF,aAAa,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;aAChE;SACF;QAAC,OAAO,KAAK,EAAE;YACd,uBAAuB;YACvB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;gBACnB,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE,oEAAoE;gBAC7E,KAAK;aACN,CAAC,CAAC;SACJ;IACH,CAAC;CACF;AA3HD,0CA2HC","sourcesContent":["import Express from \"express\";\nimport type {PlatformViews} from \"@tsed/platform-views\";\nimport {\n createContext,\n PlatformAdapter,\n PlatformApplication,\n PlatformBuilder,\n PlatformExceptions,\n PlatformHandler,\n PlatformRequest,\n PlatformResponse,\n PlatformRouter\n} from \"@tsed/common\";\nimport {Env, Type} from \"@tsed/core\";\nimport {rawBodyMiddleware} from \"../middlewares/rawBodyMiddleware\";\nimport {\n PlatformExpressApplication,\n PlatformExpressHandler,\n PlatformExpressRequest,\n PlatformExpressResponse,\n PlatformExpressRouter\n} from \"../services\";\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpress implements PlatformAdapter<Express.Application, Express.Router> {\n readonly providers = [\n {\n provide: PlatformApplication,\n useClass: PlatformExpressApplication\n },\n {\n provide: PlatformRouter,\n useClass: PlatformExpressRouter\n },\n {\n provide: PlatformHandler,\n useClass: PlatformExpressHandler\n },\n {\n provide: PlatformResponse,\n useClass: PlatformExpressResponse\n },\n {\n provide: PlatformRequest,\n useClass: PlatformExpressRequest\n }\n ];\n\n constructor(private platform: PlatformBuilder<Express.Application, Express.Router>) {}\n\n /**\n * Create new serverless application. In this mode, the component scan are disabled.\n * @param module\n * @param settings\n */\n static create(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.create<Express.Application, Express.Router>(module, {\n ...settings,\n adapter: PlatformExpress\n });\n }\n\n /**\n * Bootstrap a server application\n * @param module\n * @param settings\n */\n static async bootstrap(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.bootstrap<Express.Application, Express.Router>(module, {\n ...settings,\n adapter: PlatformExpress\n });\n }\n\n useRouter(): this {\n const {logger, app} = this.platform;\n\n logger.debug(\"Mount app router\");\n app.getApp().use(rawBodyMiddleware);\n app.getApp().use(app.getRouter());\n\n return this;\n }\n\n async beforeLoadRoutes() {\n const {injector, app} = this.platform;\n // disable x-powered-by header\n injector.settings.get(\"env\") === Env.PROD && app.getApp().disable(\"x-powered-by\");\n\n await this.configureViewsEngine();\n }\n\n async afterLoadRoutes() {\n const {injector, app} = this.platform;\n // NOT FOUND\n app.use((req: any, res: any, next: any) => {\n !res.headersSent && injector.get<PlatformExceptions>(PlatformExceptions)?.resourceNotFound(req.$ctx);\n });\n\n // EXCEPTION FILTERS\n app.use((err: any, req: any, res: any, next: any) => {\n !res.headersSent && injector.get<PlatformExceptions>(PlatformExceptions)?.catch(err, req.$ctx);\n });\n }\n\n useContext(): this {\n const {logger, app, injector} = this.platform;\n\n logger.debug(\"Mount app context\");\n\n const invoke = createContext(injector);\n\n app.getApp().use(async (request: any, response: any, next: any) => {\n await invoke({request, response});\n\n return next();\n });\n\n return this;\n }\n\n private async configureViewsEngine() {\n const {settings, injector, app} = this.platform;\n try {\n const {exists, disabled} = settings.get(\"views\") || {};\n\n if (exists && !disabled) {\n const {PlatformViews} = await import(\"@tsed/platform-views\");\n const platformViews = injector.get<PlatformViews>(PlatformViews)!;\n const express = app.getApp();\n\n platformViews.getEngines().forEach(({extension, engine}) => {\n express.engine(extension, engine.render);\n });\n\n platformViews.viewEngine && express.set(\"view engine\", platformViews.viewEngine);\n platformViews.root && express.set(\"views\", platformViews.root);\n }\n } catch (error) {\n // istanbul ignore next\n injector.logger.warn({\n event: \"PLATFORM_VIEWS_ERROR\",\n message: \"Unable to configure the PlatformViews service on your environment.\",\n error\n });\n }\n }\n}\n"]}
package/lib/cjs/index.js CHANGED
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const common_1 = require("@tsed/common");
5
5
  const PlatformExpress_1 = require("./components/PlatformExpress");
6
- common_1.PlatformTest.platformBuilder = PlatformExpress_1.PlatformExpress;
7
- common_1.PlatformBuilder.currentPlatform = PlatformExpress_1.PlatformExpress;
6
+ common_1.PlatformTest.adapter = PlatformExpress_1.PlatformExpress;
7
+ common_1.PlatformBuilder.adapter = PlatformExpress_1.PlatformExpress;
8
8
  // interfaces
9
9
  (0, tslib_1.__exportStar)(require("./interfaces"), exports);
10
10
  // decorators
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA2D;AAE3D,kEAA6D;AAE7D,qBAAY,CAAC,eAAe,GAAG,iCAAe,CAAC;AAC/C,wBAAe,CAAC,eAAe,GAAG,iCAAsB,CAAC;AAEzD,aAAa;AACb,4DAA6B;AAE7B,aAAa;AACb,4DAA6B;AAE7B,WAAW;AACX,0DAA2B;AAE3B,aAAa;AACb,4EAA6C","sourcesContent":["import {PlatformBuilder, PlatformTest} from \"@tsed/common\";\n\nimport {PlatformExpress} from \"./components/PlatformExpress\";\n\nPlatformTest.platformBuilder = PlatformExpress;\nPlatformBuilder.currentPlatform = PlatformExpress as any;\n\n// interfaces\nexport * from \"./interfaces\";\n\n// decorators\nexport * from \"./decorators\";\n\n// services\nexport * from \"./services\";\n\n// components\nexport * from \"./components/PlatformExpress\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA2D;AAE3D,kEAA6D;AAE7D,qBAAY,CAAC,OAAO,GAAG,iCAAsB,CAAC;AAC9C,wBAAe,CAAC,OAAO,GAAG,iCAAsB,CAAC;AAEjD,aAAa;AACb,4DAA6B;AAE7B,aAAa;AACb,4DAA6B;AAE7B,WAAW;AACX,0DAA2B;AAE3B,aAAa;AACb,4EAA6C","sourcesContent":["import {PlatformBuilder, PlatformTest} from \"@tsed/common\";\n\nimport {PlatformExpress} from \"./components/PlatformExpress\";\n\nPlatformTest.adapter = PlatformExpress as any;\nPlatformBuilder.adapter = PlatformExpress as any;\n\n// interfaces\nexport * from \"./interfaces\";\n\n// decorators\nexport * from \"./decorators\";\n\n// services\nexport * from \"./services\";\n\n// components\nexport * from \"./components/PlatformExpress\";\n"]}
@@ -6,18 +6,41 @@ import { PlatformExpressApplication, PlatformExpressHandler, PlatformExpressRequ
6
6
  * @platform
7
7
  * @express
8
8
  */
9
- export class PlatformExpress extends PlatformBuilder {
9
+ export class PlatformExpress {
10
+ constructor(platform) {
11
+ this.platform = platform;
12
+ this.providers = [
13
+ {
14
+ provide: PlatformApplication,
15
+ useClass: PlatformExpressApplication
16
+ },
17
+ {
18
+ provide: PlatformRouter,
19
+ useClass: PlatformExpressRouter
20
+ },
21
+ {
22
+ provide: PlatformHandler,
23
+ useClass: PlatformExpressHandler
24
+ },
25
+ {
26
+ provide: PlatformResponse,
27
+ useClass: PlatformExpressResponse
28
+ },
29
+ {
30
+ provide: PlatformRequest,
31
+ useClass: PlatformExpressRequest
32
+ }
33
+ ];
34
+ }
10
35
  /**
11
36
  * Create new serverless application. In this mode, the component scan are disabled.
12
37
  * @param module
13
38
  * @param settings
14
39
  */
15
40
  static create(module, settings = {}) {
16
- return this.build(PlatformExpress, module, {
17
- httpsPort: false,
18
- httpPort: false,
41
+ return PlatformBuilder.create(module, {
19
42
  ...settings,
20
- disableComponentsScan: true
43
+ adapter: PlatformExpress
21
44
  });
22
45
  }
23
46
  /**
@@ -26,56 +49,65 @@ export class PlatformExpress extends PlatformBuilder {
26
49
  * @param settings
27
50
  */
28
51
  static async bootstrap(module, settings = {}) {
29
- return this.build(PlatformExpress, module, settings).bootstrap();
52
+ return PlatformBuilder.bootstrap(module, {
53
+ ...settings,
54
+ adapter: PlatformExpress
55
+ });
30
56
  }
31
57
  useRouter() {
32
- this.logger.debug("Mount app router");
33
- this.app.getApp().use(rawBodyMiddleware);
34
- this.app.getApp().use(this.app.getRouter());
35
- return this;
36
- }
37
- useContext() {
38
- this.logger.debug("Mount app context");
39
- const invoke = createContext(this.injector);
40
- this.app.getApp().use(async (request, response, next) => {
41
- await invoke({ request, response });
42
- return next();
43
- });
58
+ const { logger, app } = this.platform;
59
+ logger.debug("Mount app router");
60
+ app.getApp().use(rawBodyMiddleware);
61
+ app.getApp().use(app.getRouter());
44
62
  return this;
45
63
  }
46
- async loadRoutes() {
64
+ async beforeLoadRoutes() {
65
+ const { injector, app } = this.platform;
47
66
  // disable x-powered-by header
48
- this.injector.settings.get("env") === Env.PROD && this.app.getApp().disable("x-powered-by");
67
+ injector.settings.get("env") === Env.PROD && app.getApp().disable("x-powered-by");
49
68
  await this.configureViewsEngine();
50
- await super.loadRoutes();
69
+ }
70
+ async afterLoadRoutes() {
71
+ const { injector, app } = this.platform;
51
72
  // NOT FOUND
52
- this.app.use((req, res, next) => {
73
+ app.use((req, res, next) => {
53
74
  var _a;
54
- !res.headersSent && ((_a = this.injector.get(PlatformExceptions)) === null || _a === void 0 ? void 0 : _a.resourceNotFound(req.$ctx));
75
+ !res.headersSent && ((_a = injector.get(PlatformExceptions)) === null || _a === void 0 ? void 0 : _a.resourceNotFound(req.$ctx));
55
76
  });
56
77
  // EXCEPTION FILTERS
57
- this.app.use((err, req, res, next) => {
78
+ app.use((err, req, res, next) => {
58
79
  var _a;
59
- !res.headersSent && ((_a = this.injector.get(PlatformExceptions)) === null || _a === void 0 ? void 0 : _a.catch(err, req.$ctx));
80
+ !res.headersSent && ((_a = injector.get(PlatformExceptions)) === null || _a === void 0 ? void 0 : _a.catch(err, req.$ctx));
60
81
  });
61
82
  }
83
+ useContext() {
84
+ const { logger, app, injector } = this.platform;
85
+ logger.debug("Mount app context");
86
+ const invoke = createContext(injector);
87
+ app.getApp().use(async (request, response, next) => {
88
+ await invoke({ request, response });
89
+ return next();
90
+ });
91
+ return this;
92
+ }
62
93
  async configureViewsEngine() {
94
+ const { settings, injector, app } = this.platform;
63
95
  try {
64
- const { exists, disabled } = this.settings.get("views") || {};
96
+ const { exists, disabled } = settings.get("views") || {};
65
97
  if (exists && !disabled) {
66
98
  const { PlatformViews } = await import("@tsed/platform-views");
67
- const platformViews = this.injector.get(PlatformViews);
68
- const app = this.app.getApp();
99
+ const platformViews = injector.get(PlatformViews);
100
+ const express = app.getApp();
69
101
  platformViews.getEngines().forEach(({ extension, engine }) => {
70
- app.engine(extension, engine.render);
102
+ express.engine(extension, engine.render);
71
103
  });
72
- platformViews.viewEngine && this.app.getApp().set("view engine", platformViews.viewEngine);
73
- platformViews.root && this.app.getApp().set("views", platformViews.root);
104
+ platformViews.viewEngine && express.set("view engine", platformViews.viewEngine);
105
+ platformViews.root && express.set("views", platformViews.root);
74
106
  }
75
107
  }
76
108
  catch (error) {
77
109
  // istanbul ignore next
78
- this.injector.logger.warn({
110
+ injector.logger.warn({
79
111
  event: "PLATFORM_VIEWS_ERROR",
80
112
  message: "Unable to configure the PlatformViews service on your environment.",
81
113
  error
@@ -83,26 +115,4 @@ export class PlatformExpress extends PlatformBuilder {
83
115
  }
84
116
  }
85
117
  }
86
- PlatformExpress.providers = [
87
- {
88
- provide: PlatformApplication,
89
- useClass: PlatformExpressApplication
90
- },
91
- {
92
- provide: PlatformRouter,
93
- useClass: PlatformExpressRouter
94
- },
95
- {
96
- provide: PlatformHandler,
97
- useClass: PlatformExpressHandler
98
- },
99
- {
100
- provide: PlatformResponse,
101
- useClass: PlatformExpressResponse
102
- },
103
- {
104
- provide: PlatformRequest,
105
- useClass: PlatformExpressRequest
106
- }
107
- ];
108
118
  //# sourceMappingURL=PlatformExpress.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlatformExpress.js","sourceRoot":"","sources":["../../../src/components/PlatformExpress.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,GAAG,EAAO,MAAM,YAAY,CAAC;AAErC,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACnE,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAGrB;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,eAAoD;IAwBvF;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,MAAiB,EAAE,WAAwC,EAAE;QACzE,OAAO,IAAI,CAAC,KAAK,CAAkB,eAAe,EAAE,MAAM,EAAE;YAC1D,SAAS,EAAE,KAAK;YAChB,QAAQ,EAAE,KAAK;YACf,GAAG,QAAQ;YACX,qBAAqB,EAAE,IAAI;SAC5B,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACH,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,MAAiB,EAAE,WAAwC,EAAE;QAClF,OAAO,IAAI,CAAC,KAAK,CAAkB,eAAe,E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AAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;aAC1E;SACF;QAAC,OAAO,KAAK,EAAE;YACd,uBAAuB;YACvB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;gBACxB,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE,oEAAoE;gBAC7E,KAAK;aACN,CAAC,CAAC;SACJ;IACH,CAAC;;AA/GM,yBAAS,GAAG;IACjB;QACE,OAAO,EAAE,mBAAmB;QAC5B,QAAQ,EAAE,0BAA0B;KACrC;IACD;QACE,OAAO,EAAE,cAAc;QACvB,QAAQ,EAAE,qBAAqB;KAChC;IACD;QACE,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,sBAAsB;KACjC;IACD;QACE,OAAO,EAAE,gBAAgB;QACzB,QAAQ,EAAE,uBAAuB;KAClC;IACD;QACE,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,sBAAsB;KACjC;CACF,CAAC","sourcesContent":["import {\n createContext,\n PlatformApplication,\n PlatformBuilder,\n PlatformExceptions,\n PlatformHandler,\n PlatformRequest,\n PlatformResponse,\n PlatformRouter\n} from \"@tsed/common\";\nimport {Env, Type} from \"@tsed/core\";\nimport Express from \"express\";\nimport {rawBodyMiddleware} from \"../middlewares/rawBodyMiddleware\";\nimport {\n PlatformExpressApplication,\n PlatformExpressHandler,\n PlatformExpressRequest,\n PlatformExpressResponse,\n PlatformExpressRouter\n} from \"../services\";\nimport type {PlatformViews} from \"@tsed/platform-views\";\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpress extends PlatformBuilder<Express.Application, Express.Router> {\n static providers = [\n {\n provide: PlatformApplication,\n useClass: PlatformExpressApplication\n },\n {\n provide: PlatformRouter,\n useClass: PlatformExpressRouter\n },\n {\n provide: PlatformHandler,\n useClass: PlatformExpressHandler\n },\n {\n provide: PlatformResponse,\n useClass: PlatformExpressResponse\n },\n {\n provide: PlatformRequest,\n useClass: PlatformExpressRequest\n }\n ];\n\n /**\n * Create new serverless application. In this mode, the component scan are disabled.\n * @param module\n * @param settings\n */\n static create(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return this.build<PlatformExpress>(PlatformExpress, module, {\n httpsPort: false,\n httpPort: false,\n ...settings,\n disableComponentsScan: true\n });\n }\n\n /**\n * Bootstrap a server application\n * @param module\n * @param settings\n */\n static async bootstrap(module: Type<any>, settings: Partial<TsED.Configuration> = {}): Promise<PlatformExpress> {\n return this.build<PlatformExpress>(PlatformExpress, module, settings).bootstrap();\n }\n\n protected useRouter(): this {\n this.logger.debug(\"Mount app router\");\n this.app.getApp().use(rawBodyMiddleware);\n this.app.getApp().use(this.app.getRouter());\n\n return this;\n }\n\n protected useContext(): this {\n this.logger.debug(\"Mount app context\");\n\n const invoke = createContext(this.injector);\n\n this.app.getApp().use(async (request: any, response: any, next: any) => {\n await invoke({request, response});\n\n return next();\n });\n\n return this;\n }\n\n protected async loadRoutes(): Promise<void> {\n // disable x-powered-by header\n this.injector.settings.get(\"env\") === Env.PROD && this.app.getApp().disable(\"x-powered-by\");\n\n await this.configureViewsEngine();\n\n await super.loadRoutes();\n\n // NOT FOUND\n this.app.use((req: any, res: any, next: any) => {\n !res.headersSent && this.injector.get<PlatformExceptions>(PlatformExceptions)?.resourceNotFound(req.$ctx);\n });\n\n // EXCEPTION FILTERS\n this.app.use((err: any, req: any, res: any, next: any) => {\n !res.headersSent && this.injector.get<PlatformExceptions>(PlatformExceptions)?.catch(err, req.$ctx);\n });\n }\n\n private async configureViewsEngine() {\n try {\n const {exists, disabled} = this.settings.get(\"views\") || {};\n\n if (exists && !disabled) {\n const {PlatformViews} = await import(\"@tsed/platform-views\");\n const platformViews = this.injector.get<PlatformViews>(PlatformViews)!;\n const app = this.app.getApp();\n\n platformViews.getEngines().forEach(({extension, engine}) => {\n app.engine(extension, engine.render);\n });\n\n platformViews.viewEngine && this.app.getApp().set(\"view engine\", platformViews.viewEngine);\n platformViews.root && this.app.getApp().set(\"views\", platformViews.root);\n }\n } catch (error) {\n // istanbul ignore next\n this.injector.logger.warn({\n event: \"PLATFORM_VIEWS_ERROR\",\n message: \"Unable to configure the PlatformViews service on your environment.\",\n error\n });\n }\n }\n}\n"]}
1
+ {"version":3,"file":"PlatformExpress.js","sourceRoot":"","sources":["../../../src/components/PlatformExpress.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EAEb,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAC,GAAG,EAAO,MAAM,YAAY,CAAC;AACrC,OAAO,EAAC,iBAAiB,EAAC,MAAM,kCAAkC,CAAC;AACnE,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAErB;;;GAGG;AACH,MAAM,OAAO,eAAe;IAwB1B,YAAoB,QAA8D;QAA9D,aAAQ,GAAR,QAAQ,CAAsD;QAvBzE,cAAS,GAAG;YACnB;gBACE,OAAO,EAAE,mBAAmB;gBAC5B,QAAQ,EAAE,0BAA0B;aACrC;YACD;gBACE,OAAO,EAAE,cAAc;gBACvB,QAAQ,EAAE,qBAAqB;aAChC;YACD;gBACE,OAAO,EAAE,eAAe;gBACxB,QAAQ,EAAE,sBAAsB;aACjC;YACD;gBACE,OAAO,EAAE,gBAAgB;gBACzB,QAAQ,EAAE,uBAAuB;aAClC;YACD;gBACE,OAAO,EAAE,eAAe;gBACxB,QAAQ,EAAE,sBAAsB;aACjC;SACF,CAAC;IAEmF,CAAC;IAEtF;;;;OAIG;IACH,MAAM,CAAC,MAAM,CAAC,MAAiB,EAAE,WAAwC,EAAE;QACzE,OAAO,eAAe,CAAC,MAAM,CAAsC,MAAM,EAAE;YACzE,GAAG,QAAQ;YACX,OAAO,EAAE,eAAe;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gBAE7B,aAAa,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,CAAC,EAAC,SAAS,EAAE,MAAM,EAAC,EAAE,EAAE;oBACzD,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC3C,CAAC,CAAC,CAAC;gBAEH,aAAa,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;gBACjF,aAAa,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;aAChE;SACF;QAAC,OAAO,KAAK,EAAE;YACd,uBAAuB;YACvB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;gBACnB,KAAK,EAAE,sBAAsB;gBAC7B,OAAO,EAAE,oEAAoE;gBAC7E,KAAK;aACN,CAAC,CAAC;SACJ;IACH,CAAC;CACF","sourcesContent":["import Express from \"express\";\nimport type {PlatformViews} from \"@tsed/platform-views\";\nimport {\n createContext,\n PlatformAdapter,\n PlatformApplication,\n PlatformBuilder,\n PlatformExceptions,\n PlatformHandler,\n PlatformRequest,\n PlatformResponse,\n PlatformRouter\n} from \"@tsed/common\";\nimport {Env, Type} from \"@tsed/core\";\nimport {rawBodyMiddleware} from \"../middlewares/rawBodyMiddleware\";\nimport {\n PlatformExpressApplication,\n PlatformExpressHandler,\n PlatformExpressRequest,\n PlatformExpressResponse,\n PlatformExpressRouter\n} from \"../services\";\n\n/**\n * @platform\n * @express\n */\nexport class PlatformExpress implements PlatformAdapter<Express.Application, Express.Router> {\n readonly providers = [\n {\n provide: PlatformApplication,\n useClass: PlatformExpressApplication\n },\n {\n provide: PlatformRouter,\n useClass: PlatformExpressRouter\n },\n {\n provide: PlatformHandler,\n useClass: PlatformExpressHandler\n },\n {\n provide: PlatformResponse,\n useClass: PlatformExpressResponse\n },\n {\n provide: PlatformRequest,\n useClass: PlatformExpressRequest\n }\n ];\n\n constructor(private platform: PlatformBuilder<Express.Application, Express.Router>) {}\n\n /**\n * Create new serverless application. In this mode, the component scan are disabled.\n * @param module\n * @param settings\n */\n static create(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.create<Express.Application, Express.Router>(module, {\n ...settings,\n adapter: PlatformExpress\n });\n }\n\n /**\n * Bootstrap a server application\n * @param module\n * @param settings\n */\n static async bootstrap(module: Type<any>, settings: Partial<TsED.Configuration> = {}) {\n return PlatformBuilder.bootstrap<Express.Application, Express.Router>(module, {\n ...settings,\n adapter: PlatformExpress\n });\n }\n\n useRouter(): this {\n const {logger, app} = this.platform;\n\n logger.debug(\"Mount app router\");\n app.getApp().use(rawBodyMiddleware);\n app.getApp().use(app.getRouter());\n\n return this;\n }\n\n async beforeLoadRoutes() {\n const {injector, app} = this.platform;\n // disable x-powered-by header\n injector.settings.get(\"env\") === Env.PROD && app.getApp().disable(\"x-powered-by\");\n\n await this.configureViewsEngine();\n }\n\n async afterLoadRoutes() {\n const {injector, app} = this.platform;\n // NOT FOUND\n app.use((req: any, res: any, next: any) => {\n !res.headersSent && injector.get<PlatformExceptions>(PlatformExceptions)?.resourceNotFound(req.$ctx);\n });\n\n // EXCEPTION FILTERS\n app.use((err: any, req: any, res: any, next: any) => {\n !res.headersSent && injector.get<PlatformExceptions>(PlatformExceptions)?.catch(err, req.$ctx);\n });\n }\n\n useContext(): this {\n const {logger, app, injector} = this.platform;\n\n logger.debug(\"Mount app context\");\n\n const invoke = createContext(injector);\n\n app.getApp().use(async (request: any, response: any, next: any) => {\n await invoke({request, response});\n\n return next();\n });\n\n return this;\n }\n\n private async configureViewsEngine() {\n const {settings, injector, app} = this.platform;\n try {\n const {exists, disabled} = settings.get(\"views\") || {};\n\n if (exists && !disabled) {\n const {PlatformViews} = await import(\"@tsed/platform-views\");\n const platformViews = injector.get<PlatformViews>(PlatformViews)!;\n const express = app.getApp();\n\n platformViews.getEngines().forEach(({extension, engine}) => {\n express.engine(extension, engine.render);\n });\n\n platformViews.viewEngine && express.set(\"view engine\", platformViews.viewEngine);\n platformViews.root && express.set(\"views\", platformViews.root);\n }\n } catch (error) {\n // istanbul ignore next\n injector.logger.warn({\n event: \"PLATFORM_VIEWS_ERROR\",\n message: \"Unable to configure the PlatformViews service on your environment.\",\n error\n });\n }\n }\n}\n"]}
package/lib/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PlatformBuilder, PlatformTest } from "@tsed/common";
2
2
  import { PlatformExpress } from "./components/PlatformExpress";
3
- PlatformTest.platformBuilder = PlatformExpress;
4
- PlatformBuilder.currentPlatform = PlatformExpress;
3
+ PlatformTest.adapter = PlatformExpress;
4
+ PlatformBuilder.adapter = PlatformExpress;
5
5
  // interfaces
6
6
  export * from "./interfaces";
7
7
  // decorators
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAE7D,YAAY,CAAC,eAAe,GAAG,eAAe,CAAC;AAC/C,eAAe,CAAC,eAAe,GAAG,eAAsB,CAAC;AAEzD,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,WAAW;AACX,cAAc,YAAY,CAAC;AAE3B,aAAa;AACb,cAAc,8BAA8B,CAAC","sourcesContent":["import {PlatformBuilder, PlatformTest} from \"@tsed/common\";\n\nimport {PlatformExpress} from \"./components/PlatformExpress\";\n\nPlatformTest.platformBuilder = PlatformExpress;\nPlatformBuilder.currentPlatform = PlatformExpress as any;\n\n// interfaces\nexport * from \"./interfaces\";\n\n// decorators\nexport * from \"./decorators\";\n\n// services\nexport * from \"./services\";\n\n// components\nexport * from \"./components/PlatformExpress\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,YAAY,EAAC,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAC,eAAe,EAAC,MAAM,8BAA8B,CAAC;AAE7D,YAAY,CAAC,OAAO,GAAG,eAAsB,CAAC;AAC9C,eAAe,CAAC,OAAO,GAAG,eAAsB,CAAC;AAEjD,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,cAAc,CAAC;AAE7B,WAAW;AACX,cAAc,YAAY,CAAC;AAE3B,aAAa;AACb,cAAc,8BAA8B,CAAC","sourcesContent":["import {PlatformBuilder, PlatformTest} from \"@tsed/common\";\n\nimport {PlatformExpress} from \"./components/PlatformExpress\";\n\nPlatformTest.adapter = PlatformExpress as any;\nPlatformBuilder.adapter = PlatformExpress as any;\n\n// interfaces\nexport * from \"./interfaces\";\n\n// decorators\nexport * from \"./decorators\";\n\n// services\nexport * from \"./services\";\n\n// components\nexport * from \"./components/PlatformExpress\";\n"]}
@@ -1,13 +1,14 @@
1
- import { PlatformBuilder, PlatformHandler, PlatformRequest, PlatformResponse, PlatformRouter } from "@tsed/common";
2
- import { Type } from "@tsed/core";
3
1
  import Express from "express";
2
+ import { PlatformAdapter, PlatformBuilder, PlatformHandler, PlatformRequest, PlatformResponse, PlatformRouter } from "@tsed/common";
3
+ import { Type } from "@tsed/core";
4
4
  import { PlatformExpressHandler, PlatformExpressRequest, PlatformExpressResponse, PlatformExpressRouter } from "../services";
5
5
  /**
6
6
  * @platform
7
7
  * @express
8
8
  */
9
- export declare class PlatformExpress extends PlatformBuilder<Express.Application, Express.Router> {
10
- static providers: ({
9
+ export declare class PlatformExpress implements PlatformAdapter<Express.Application, Express.Router> {
10
+ private platform;
11
+ readonly providers: ({
11
12
  provide: typeof PlatformRouter;
12
13
  useClass: typeof PlatformExpressRouter;
13
14
  } | {
@@ -20,20 +21,22 @@ export declare class PlatformExpress extends PlatformBuilder<Express.Application
20
21
  provide: typeof PlatformRequest;
21
22
  useClass: typeof PlatformExpressRequest;
22
23
  })[];
24
+ constructor(platform: PlatformBuilder<Express.Application, Express.Router>);
23
25
  /**
24
26
  * Create new serverless application. In this mode, the component scan are disabled.
25
27
  * @param module
26
28
  * @param settings
27
29
  */
28
- static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformExpress;
30
+ static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformBuilder<Express.Application, Express.Router>;
29
31
  /**
30
32
  * Bootstrap a server application
31
33
  * @param module
32
34
  * @param settings
33
35
  */
34
- static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformExpress>;
35
- protected useRouter(): this;
36
- protected useContext(): this;
37
- protected loadRoutes(): Promise<void>;
36
+ static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformBuilder<Express.Application, Express.Router>>;
37
+ useRouter(): this;
38
+ beforeLoadRoutes(): Promise<void>;
39
+ afterLoadRoutes(): Promise<void>;
40
+ useContext(): this;
38
41
  private configureViewsEngine;
39
42
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/platform-express",
3
- "version": "6.89.0",
3
+ "version": "6.92.1",
4
4
  "description": "A TypeScript Framework on top of Express",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
@@ -54,10 +54,10 @@
54
54
  "tslib": "2.2.0"
55
55
  },
56
56
  "devDependencies": {
57
- "@tsed/common": "6.89.0",
58
- "@tsed/core": "6.89.0",
59
- "@tsed/di": "6.89.0",
60
- "@tsed/platform-test-utils": "6.89.0",
57
+ "@tsed/common": "6.92.1",
58
+ "@tsed/core": "6.92.1",
59
+ "@tsed/di": "6.92.1",
60
+ "@tsed/platform-test-utils": "6.92.1",
61
61
  "@types/body-parser": "1.19.0",
62
62
  "@types/compression": "1.7.0",
63
63
  "@types/cookie-parser": "1.4.2",
@@ -73,13 +73,13 @@
73
73
  "method-override": "3.0.0"
74
74
  },
75
75
  "peerDependencies": {
76
- "@tsed/common": "^6.89.0",
77
- "@tsed/core": "^6.89.0",
78
- "@tsed/di": "^6.89.0",
79
- "@tsed/json-mapper": "^6.89.0",
76
+ "@tsed/common": "^6.92.1",
77
+ "@tsed/core": "^6.92.1",
78
+ "@tsed/di": "^6.92.1",
79
+ "@tsed/json-mapper": "^6.92.1",
80
80
  "@tsed/logger": ">=6.0.0",
81
- "@tsed/openspec": "^6.89.0",
82
- "@tsed/schema": "^6.89.0",
81
+ "@tsed/openspec": "^6.92.1",
82
+ "@tsed/schema": "^6.92.1",
83
83
  "@types/multer": "^1.4.5",
84
84
  "body-parser": "1.19.0"
85
85
  }