feat: expose app.server (#3601)

This commit is contained in:
TZ | 天猪 2019-04-10 10:51:24 +08:00 committed by Yiyu He
parent 328cbf2568
commit 9671a354a9
2 changed files with 7 additions and 1 deletions

View File

@ -47,6 +47,9 @@ class Application extends EggApplication {
options.type = 'application';
super(options);
// will auto set after 'server' event emit
this.server = null;
try {
this.loader.load();
} catch (e) {
@ -85,6 +88,9 @@ class Application extends EggApplication {
}
onServer(server) {
// expose app.server
this.server = server;
/* istanbul ignore next */
graceful({
server: [ server ],

View File

@ -78,7 +78,7 @@
"spy": "^1.0.0",
"supertest": "^3.0.0",
"ts-node": "^3.0.6",
"typescript": "^2.3.4",
"typescript": "^3.4.1",
"webstorm-disable-index": "^1.1.2"
},
"main": "index.js",