feat: split start and listen

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
MiaoWoo 2019-10-17 17:57:10 +08:00
parent ac73c52395
commit 831a47fbf3

View File

@ -122,10 +122,13 @@ export class CcServerBoot {
return this; return this;
} }
public start(port: number = 80) { public start() {
const routeInfo = getRouteInfo(this._container); console.log(prettyjson.render({ routes: { http: getRouteInfo(this._container), websocket: getNamespaceInfo() } }));
console.log(prettyjson.render({ routes: routeInfo })); return this;
}
public listen(port: number = 80) {
this._server.listen(port); this._server.listen(port);
console.log(`Server started on port ${port} :)`); console.log(`Server listen on port ${port} :)`);
} }
} }