mirror of
https://github.com/eggjs/egg.git
synced 2024-12-04 07:14:30 +00:00
feat: expose app.server (#3601)
This commit is contained in:
parent
328cbf2568
commit
9671a354a9
@ -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 ],
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user