@midwayjs/express 3.15.7 → 3.15.10

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.
package/dist/framework.js CHANGED
@@ -114,24 +114,28 @@ let MidwayExpressFramework = class MidwayExpressFramework extends core_1.BaseFra
114
114
  next(err);
115
115
  });
116
116
  });
117
+ const serverOptions = {
118
+ ...this.configurationOptions,
119
+ ...this.configurationOptions.serverOptions,
120
+ };
117
121
  // https config
118
122
  if (this.configurationOptions.key && this.configurationOptions.cert) {
119
123
  this.configurationOptions.key = core_1.PathFileUtil.getFileContentSync(this.configurationOptions.key);
120
124
  this.configurationOptions.cert = core_1.PathFileUtil.getFileContentSync(this.configurationOptions.cert);
121
125
  this.configurationOptions.ca = core_1.PathFileUtil.getFileContentSync(this.configurationOptions.ca);
122
126
  if (this.configurationOptions.http2) {
123
- this.server = require('http2').createSecureServer(this.configurationOptions, this.app);
127
+ this.server = require('http2').createSecureServer(serverOptions, this.app);
124
128
  }
125
129
  else {
126
- this.server = require('https').createServer(this.configurationOptions, this.app);
130
+ this.server = require('https').createServer(serverOptions, this.app);
127
131
  }
128
132
  }
129
133
  else {
130
134
  if (this.configurationOptions.http2) {
131
- this.server = require('http2').createServer(this.app);
135
+ this.server = require('http2').createServer(serverOptions, this.app);
132
136
  }
133
137
  else {
134
- this.server = require('http').createServer(this.app);
138
+ this.server = require('http').createServer(serverOptions, this.app);
135
139
  }
136
140
  }
137
141
  // register httpServer to applicationContext
@@ -65,6 +65,10 @@ export interface IMidwayExpressConfigurationOptions extends IConfigurationOption
65
65
  * http global prefix
66
66
  */
67
67
  globalPrefix?: string;
68
+ /**
69
+ * https/https/http2 server options
70
+ */
71
+ serverOptions?: Record<string, any>;
68
72
  }
69
73
  export type Application = IMidwayExpressApplication;
70
74
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midwayjs/express",
3
- "version": "3.15.7",
3
+ "version": "3.15.10",
4
4
  "description": "Midway Web Framework for Express",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
@@ -24,14 +24,14 @@
24
24
  ],
25
25
  "license": "MIT",
26
26
  "devDependencies": {
27
- "@midwayjs/mock": "^3.15.6",
27
+ "@midwayjs/mock": "^3.15.8",
28
28
  "@types/body-parser": "1.19.5",
29
29
  "@types/express": "4.17.21",
30
30
  "fs-extra": "11.2.0"
31
31
  },
32
32
  "dependencies": {
33
- "@midwayjs/core": "^3.15.6",
34
- "@midwayjs/express-session": "^3.15.6",
33
+ "@midwayjs/core": "^3.15.8",
34
+ "@midwayjs/express-session": "^3.15.8",
35
35
  "body-parser": "1.20.2",
36
36
  "cookie-parser": "^1.4.6",
37
37
  "express": "4.19.2"
@@ -44,5 +44,5 @@
44
44
  "engines": {
45
45
  "node": ">=12"
46
46
  },
47
- "gitHead": "e84086193219236deb4bb2aec161a04424a69f2a"
47
+ "gitHead": "11f56659d35b95d5abebceab40bf4e9ac7b67b99"
48
48
  }