@midwayjs/web 3.15.6 → 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/web.js +8 -4
- package/dist/interface.d.ts +4 -0
- package/package.json +5 -5
package/dist/framework/web.js
CHANGED
|
@@ -172,24 +172,28 @@ let MidwayWebFramework = class MidwayWebFramework extends core_1.BaseFramework {
|
|
|
172
172
|
if (!this.isClusterMode) {
|
|
173
173
|
// load controller
|
|
174
174
|
await this.loadMidwayController();
|
|
175
|
+
const serverOptions = {
|
|
176
|
+
...this.configurationOptions,
|
|
177
|
+
...this.configurationOptions.serverOptions,
|
|
178
|
+
};
|
|
175
179
|
// https config
|
|
176
180
|
if (this.configurationOptions.key && this.configurationOptions.cert) {
|
|
177
181
|
this.configurationOptions.key = core_1.PathFileUtil.getFileContentSync(this.configurationOptions.key);
|
|
178
182
|
this.configurationOptions.cert = core_1.PathFileUtil.getFileContentSync(this.configurationOptions.cert);
|
|
179
183
|
this.configurationOptions.ca = core_1.PathFileUtil.getFileContentSync(this.configurationOptions.ca);
|
|
180
184
|
if (this.configurationOptions.http2) {
|
|
181
|
-
this.server = require('http2').createSecureServer(
|
|
185
|
+
this.server = require('http2').createSecureServer(serverOptions, this.app.callback());
|
|
182
186
|
}
|
|
183
187
|
else {
|
|
184
|
-
this.server = require('https').createServer(
|
|
188
|
+
this.server = require('https').createServer(serverOptions, this.app.callback());
|
|
185
189
|
}
|
|
186
190
|
}
|
|
187
191
|
else {
|
|
188
192
|
if (this.configurationOptions.http2) {
|
|
189
|
-
this.server = require('http2').createServer(this.app.callback());
|
|
193
|
+
this.server = require('http2').createServer(serverOptions, this.app.callback());
|
|
190
194
|
}
|
|
191
195
|
else {
|
|
192
|
-
this.server = require('http').createServer(this.app.callback());
|
|
196
|
+
this.server = require('http').createServer(serverOptions, this.app.callback());
|
|
193
197
|
}
|
|
194
198
|
}
|
|
195
199
|
// emit egg-ready message in agent and application
|
package/dist/interface.d.ts
CHANGED
|
@@ -115,6 +115,10 @@ export interface IMidwayWebConfigurationOptions extends IConfigurationOptions {
|
|
|
115
115
|
* http query parse options, used when 'simple' mode is used
|
|
116
116
|
*/
|
|
117
117
|
queryParseOptions?: IParseOptions;
|
|
118
|
+
/**
|
|
119
|
+
* https/https/http2 server options
|
|
120
|
+
*/
|
|
121
|
+
serverOptions?: Record<string, any>;
|
|
118
122
|
}
|
|
119
123
|
/**
|
|
120
124
|
* @deprecated since version 3.0.0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/web",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.10",
|
|
4
4
|
"description": "Midway Web Framework for Egg.js",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@midwayjs/logger": "^3.0.0",
|
|
32
|
-
"@midwayjs/mock": "^3.15.
|
|
32
|
+
"@midwayjs/mock": "^3.15.8",
|
|
33
33
|
"dayjs": "1.11.10",
|
|
34
34
|
"egg-logger": "3.4.2",
|
|
35
35
|
"egg-mock": "4.2.1",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@eggjs/router": "^2.0.0",
|
|
48
|
-
"@midwayjs/core": "^3.15.
|
|
48
|
+
"@midwayjs/core": "^3.15.8",
|
|
49
49
|
"egg": "^2.28.0",
|
|
50
50
|
"egg-cluster": "^1.27.1",
|
|
51
51
|
"find-up": "5.0.0",
|
|
52
52
|
"mkdirp": "1.0.4",
|
|
53
|
-
"qs": "6.
|
|
53
|
+
"qs": "6.12.0"
|
|
54
54
|
},
|
|
55
55
|
"author": "Harry Chen <czy88840616@gmail.com>",
|
|
56
56
|
"repository": {
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">=12"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "11f56659d35b95d5abebceab40bf4e9ac7b67b99"
|
|
64
64
|
}
|