From 831a47fbf3e10d652df32391431160a950f6c136 Mon Sep 17 00:00:00 2001 From: MiaoWoo Date: Thu, 17 Oct 2019 17:57:10 +0800 Subject: [PATCH] feat: split start and listen Signed-off-by: MiaoWoo --- packages/core/src/index.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 9a075b2..c481c89 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -122,10 +122,13 @@ export class CcServerBoot { return this; } - public start(port: number = 80) { - const routeInfo = getRouteInfo(this._container); - console.log(prettyjson.render({ routes: routeInfo })); + public start() { + console.log(prettyjson.render({ routes: { http: getRouteInfo(this._container), websocket: getNamespaceInfo() } })); + return this; + } + + public listen(port: number = 80) { this._server.listen(port); - console.log(`Server started on port ${port} :)`); + console.log(`Server listen on port ${port} :)`); } }