@midwayjs/koa 3.15.8 → 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 +8 -4
- package/dist/interface.d.ts +4 -0
- package/package.json +2 -2
package/dist/framework.js
CHANGED
|
@@ -145,24 +145,28 @@ let MidwayKoaFramework = class MidwayKoaFramework extends core_1.BaseFramework {
|
|
|
145
145
|
await this.loadMidwayController();
|
|
146
146
|
// restore use method
|
|
147
147
|
this.app.use = this.app.originUse;
|
|
148
|
+
const serverOptions = {
|
|
149
|
+
...this.configurationOptions,
|
|
150
|
+
...this.configurationOptions.serverOptions,
|
|
151
|
+
};
|
|
148
152
|
// https config
|
|
149
153
|
if (this.configurationOptions.key && this.configurationOptions.cert) {
|
|
150
154
|
this.configurationOptions.key = core_1.PathFileUtil.getFileContentSync(this.configurationOptions.key);
|
|
151
155
|
this.configurationOptions.cert = core_1.PathFileUtil.getFileContentSync(this.configurationOptions.cert);
|
|
152
156
|
this.configurationOptions.ca = core_1.PathFileUtil.getFileContentSync(this.configurationOptions.ca);
|
|
153
157
|
if (this.configurationOptions.http2) {
|
|
154
|
-
this.server = require('http2').createSecureServer(
|
|
158
|
+
this.server = require('http2').createSecureServer(serverOptions, this.app.callback());
|
|
155
159
|
}
|
|
156
160
|
else {
|
|
157
|
-
this.server = require('https').createServer(
|
|
161
|
+
this.server = require('https').createServer(serverOptions, this.app.callback());
|
|
158
162
|
}
|
|
159
163
|
}
|
|
160
164
|
else {
|
|
161
165
|
if (this.configurationOptions.http2) {
|
|
162
|
-
this.server = require('http2').createServer(this.app.callback());
|
|
166
|
+
this.server = require('http2').createServer(serverOptions, this.app.callback());
|
|
163
167
|
}
|
|
164
168
|
else {
|
|
165
|
-
this.server = require('http').createServer(this.app.callback());
|
|
169
|
+
this.server = require('http').createServer(serverOptions, this.app.callback());
|
|
166
170
|
}
|
|
167
171
|
}
|
|
168
172
|
// register httpServer to applicationContext
|
package/dist/interface.d.ts
CHANGED
|
@@ -76,6 +76,10 @@ export interface IMidwayKoaConfigurationOptions extends IConfigurationOptions {
|
|
|
76
76
|
* @see https://nodejs.org/api/http.html#http_server_timeout
|
|
77
77
|
*/
|
|
78
78
|
serverTimeout?: number;
|
|
79
|
+
/**
|
|
80
|
+
* https/https/http2 server options
|
|
81
|
+
*/
|
|
82
|
+
serverOptions?: Record<string, any>;
|
|
79
83
|
}
|
|
80
84
|
export type MiddlewareParamArray = Array<Middleware<DefaultState, IMidwayKoaContext>>;
|
|
81
85
|
export interface IWebMiddleware {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midwayjs/koa",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.10",
|
|
4
4
|
"description": "Midway Web Framework for KOA",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "index.d.ts",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"engines": {
|
|
46
46
|
"node": ">=12"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "11f56659d35b95d5abebceab40bf4e9ac7b67b99"
|
|
49
49
|
}
|