@tsed/platform-express 8.38.0-beta.4 → 8.38.0-beta.5

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,6 +1,6 @@
1
1
  import "@tsed/platform-multer/express";
2
- import { Env, catchAsyncError, isArray, isFunction } from "@tsed/core";
3
- import { PlatformAdapter, PlatformBuilder, PlatformHandler, PlatformResponse, adapter, application, createContext } from "@tsed/platform-http";
2
+ import { catchAsyncError, Env, isArray, isFunction } from "@tsed/core";
3
+ import { adapter, application, createContext, PlatformAdapter, PlatformBuilder, PlatformHandler, PlatformResponse } from "@tsed/platform-http";
4
4
  import { PlatformHandlerType } from "@tsed/platform-router";
5
5
  import { constant, inject, logger, runInContext } from "@tsed/di";
6
6
  import { dirname, join } from "node:path";
@@ -39,27 +39,21 @@ export class PlatformExpress extends PlatformAdapter {
39
39
  super(...arguments);
40
40
  this.NAME = "express";
41
41
  }
42
- /**
43
- * Create new serverless application. In this mode, the component scan are disabled.
44
- * @param module
45
- * @param settings
46
- */
47
- static create(module, settings = {}) {
48
- return PlatformBuilder.create(module, {
49
- ...settings,
42
+ static create(module, settings) {
43
+ return new PlatformBuilder({
44
+ rootModule: settings ? module : undefined,
45
+ httpsPort: false,
46
+ httpPort: false,
47
+ ...(settings || module),
50
48
  adapter: PlatformExpress
51
49
  });
52
50
  }
53
- /**
54
- * Bootstrap a server application
55
- * @param module
56
- * @param settings
57
- */
58
- static bootstrap(module, settings = {}) {
59
- return PlatformBuilder.bootstrap(module, {
60
- ...settings,
51
+ static bootstrap(module, settings) {
52
+ return new PlatformBuilder({
53
+ rootModule: settings ? module : undefined,
54
+ ...(settings || module),
61
55
  adapter: PlatformExpress
62
- });
56
+ }).bootstrap();
63
57
  }
64
58
  async beforeLoadRoutes() {
65
59
  const { app } = this;
@@ -33,13 +33,15 @@ export declare class PlatformExpress extends PlatformAdapter<Express.Application
33
33
  * @param module
34
34
  * @param settings
35
35
  */
36
+ static create(settings: Partial<TsED.Configuration>): PlatformBuilder<Express.Application>;
36
37
  static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformBuilder<Express.Application>;
37
38
  /**
38
39
  * Bootstrap a server application
39
40
  * @param module
40
41
  * @param settings
41
42
  */
42
- static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformBuilder<Express.Application>>;
43
+ static bootstrap(settings: Partial<TsED.Configuration>): Promise<PlatformBuilder<Express.Application>>;
44
+ static bootstrap(module: Type<any>, settings: Partial<TsED.Configuration>): Promise<PlatformBuilder<Express.Application>>;
43
45
  beforeLoadRoutes(): Promise<void>;
44
46
  afterLoadRoutes(): Promise<void>;
45
47
  mapLayers(layers: PlatformLayer[]): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/platform-express",
3
- "version": "8.38.0-beta.4",
3
+ "version": "8.38.0-beta.5",
4
4
  "description": "A TypeScript Framework on top of Express",
5
5
  "keywords": [
6
6
  "Controller",
@@ -58,13 +58,13 @@
58
58
  "tslib": ">=2.7.0"
59
59
  },
60
60
  "devDependencies": {
61
- "@tsed/barrels": "8.38.0-beta.4",
62
- "@tsed/core": "8.38.0-beta.4",
63
- "@tsed/di": "8.38.0-beta.4",
64
- "@tsed/platform-http": "8.38.0-beta.4",
65
- "@tsed/platform-test-sdk": "8.38.0-beta.4",
66
- "@tsed/platform-views": "8.38.0-beta.4",
67
- "@tsed/typescript": "8.38.0-beta.4",
61
+ "@tsed/barrels": "8.38.0-beta.5",
62
+ "@tsed/core": "8.38.0-beta.5",
63
+ "@tsed/di": "8.38.0-beta.5",
64
+ "@tsed/platform-http": "8.38.0-beta.5",
65
+ "@tsed/platform-test-sdk": "8.38.0-beta.5",
66
+ "@tsed/platform-views": "8.38.0-beta.5",
67
+ "@tsed/typescript": "8.38.0-beta.5",
68
68
  "@types/body-parser": "1.19.5",
69
69
  "@types/compression": "1.7.5",
70
70
  "@types/cookie-parser": "1.4.7",