server: update log info

pull/59/head
fantasticit 2022-05-21 14:54:53 +08:00
parent f57e2bf23c
commit fe60c43fba
1 changed files with 4 additions and 2 deletions

View File

@ -13,6 +13,7 @@ async function bootstrap() {
logger: false, logger: false,
}); });
const config = app.get(ConfigService); const config = app.get(ConfigService);
const port = config.get('server.port') || 5002;
app.enableCors(); app.enableCors();
app.use(helmet()); app.use(helmet());
@ -22,8 +23,9 @@ async function bootstrap() {
app.useGlobalInterceptors(new HttpResponseTransformInterceptor()); app.useGlobalInterceptors(new HttpResponseTransformInterceptor());
app.useGlobalPipes(new ValidationPipe()); app.useGlobalPipes(new ValidationPipe());
app.setGlobalPrefix(config.get('server.prefix') || '/'); app.setGlobalPrefix(config.get('server.prefix') || '/');
await app.listen(config.get('server.port') || 4000);
console.log('[think] 主服务启动成功'); await app.listen(port);
console.log(`[think] 主服务启动成功,端口:${port}`);
} }
bootstrap(); bootstrap();