@tsed/platform-koa 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.
@@ -34,27 +34,21 @@ export class PlatformKoa extends PlatformAdapter {
34
34
  super(...arguments);
35
35
  this.NAME = "koa";
36
36
  }
37
- /**
38
- * Create new serverless application. In this mode, the component scan are disabled.
39
- * @param module
40
- * @param settings
41
- */
42
- static create(module, settings = {}) {
43
- return PlatformBuilder.create(module, {
44
- ...settings,
37
+ static create(module, settings) {
38
+ return new PlatformBuilder({
39
+ rootModule: settings ? module : undefined,
40
+ httpsPort: false,
41
+ httpPort: false,
42
+ ...(settings || module),
45
43
  adapter: PlatformKoa
46
44
  });
47
45
  }
48
- /**
49
- * Bootstrap a server application
50
- * @param module
51
- * @param settings
52
- */
53
- static bootstrap(module, settings = {}) {
54
- return PlatformBuilder.bootstrap(module, {
55
- ...settings,
46
+ static bootstrap(module, settings) {
47
+ return new PlatformBuilder({
48
+ rootModule: settings ? module : undefined,
49
+ ...(settings || module),
56
50
  adapter: PlatformKoa
57
- });
51
+ }).bootstrap();
58
52
  }
59
53
  onInit() {
60
54
  this.app.getApp().silent = true;
@@ -25,13 +25,15 @@ export declare class PlatformKoa extends PlatformAdapter<Koa> {
25
25
  * @param module
26
26
  * @param settings
27
27
  */
28
- static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformBuilder<Koa<Koa.DefaultState, Koa.DefaultContext>>;
28
+ static create(settings: Partial<TsED.Configuration>): PlatformBuilder<Koa>;
29
+ static create(module: Type<any>, settings?: Partial<TsED.Configuration>): PlatformBuilder<Koa>;
29
30
  /**
30
31
  * Bootstrap a server application
31
32
  * @param module
32
33
  * @param settings
33
34
  */
34
- static bootstrap(module: Type<any>, settings?: Partial<TsED.Configuration>): Promise<PlatformBuilder<Koa<Koa.DefaultState, Koa.DefaultContext>>>;
35
+ static bootstrap(settings: Partial<TsED.Configuration>): Promise<PlatformBuilder<Koa>>;
36
+ static bootstrap(module: Type<any>, settings: Partial<TsED.Configuration>): Promise<PlatformBuilder<Koa>>;
35
37
  onInit(): void;
36
38
  mapLayers(layers: PlatformLayer[]): void;
37
39
  mapHandler(handler: Function, metadata: PlatformHandlerMetadata): (koaContext: Koa.Context, next: Koa.Next) => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsed/platform-koa",
3
- "version": "8.38.0-beta.4",
3
+ "version": "8.38.0-beta.5",
4
4
  "description": "Koa package for Ts.ED framework",
5
5
  "keywords": [
6
6
  "Controller",
@@ -61,12 +61,12 @@
61
61
  },
62
62
  "devDependencies": {
63
63
  "@koa/cors": "5.0.0",
64
- "@tsed/barrels": "8.38.0-beta.4",
65
- "@tsed/core": "8.38.0-beta.4",
66
- "@tsed/di": "8.38.0-beta.4",
67
- "@tsed/platform-http": "8.38.0-beta.4",
68
- "@tsed/platform-test-sdk": "8.38.0-beta.4",
69
- "@tsed/typescript": "8.38.0-beta.4",
64
+ "@tsed/barrels": "8.38.0-beta.5",
65
+ "@tsed/core": "8.38.0-beta.5",
66
+ "@tsed/di": "8.38.0-beta.5",
67
+ "@tsed/platform-http": "8.38.0-beta.5",
68
+ "@tsed/platform-test-sdk": "8.38.0-beta.5",
69
+ "@tsed/typescript": "8.38.0-beta.5",
70
70
  "@types/koa": "2.15.0",
71
71
  "@types/koa-bodyparser": "4.3.12",
72
72
  "@types/koa-compose": "3.2.8",