From 0a0f99958964c79920bb2bc21397cde8eb277aaa Mon Sep 17 00:00:00 2001 From: liuyun Date: Sat, 10 Oct 2026 21:47:12 +0800 Subject: [PATCH] feat: log startup success and swagger address Co-Authored-By: Claude Opus 4.8 --- src/main.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index 30a4efd..e2dd848 100644 --- a/src/main.ts +++ b/src/main.ts @@ -13,13 +13,19 @@ async function bootstrap(): Promise { app.useLogger(app.get(Logger)); const swaggerConfig = new DocumentBuilder() - .setTitle('sysmgr API') - .setDescription('通用系统管理脚手架 API 文档') + .setTitle('系统管理 API') + .setDescription('投云科技系统管理 API 文档') .setVersion('1.0') .addBearerAuth() .build(); - SwaggerModule.setup('docs', app, SwaggerModule.createDocument(app, swaggerConfig)); + SwaggerModule.setup( + 'docs', + app, + SwaggerModule.createDocument(app, swaggerConfig), + ); - await app.listen(process.env.PORT ?? 3000); + const port = Number(process.env.PORT ?? 3000); + await app.listen(port); + app.get(Logger).log(`服务启动成功,端口 ${port},Swagger 文档: http://localhost:${port}/docs`); } await bootstrap();