fix(health): exclude /health endpoint from API prefix

The health check endpoint should be at /health not /api/v1/health
for Docker health checks to work properly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-10 02:30:24 -08:00
parent 223aa25af1
commit 224e1fb509
5 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@ async function bootstrap() {
}); });
// API prefix // API prefix
app.setGlobalPrefix('api/v1'); app.setGlobalPrefix('api/v1', { exclude: ['health'] });
const configService = app.get(ConfigService); const configService = app.get(ConfigService);
const port = configService.get<number>('PORT') || 3004; const port = configService.get<number>('PORT') || 3004;

View File

@ -5,7 +5,7 @@ async function bootstrap() {
const app = await NestFactory.create(AppModule); const app = await NestFactory.create(AppModule);
// 设置全局前缀 // 设置全局前缀
app.setGlobalPrefix('api/v1'); app.setGlobalPrefix('api/v1', { exclude: ['health'] });
// 启用CORS // 启用CORS
app.enableCors({ app.enableCors({

View File

@ -5,7 +5,7 @@ async function bootstrap() {
const app = await NestFactory.create(AppModule); const app = await NestFactory.create(AppModule);
// 设置全局前缀 // 设置全局前缀
app.setGlobalPrefix('api/v1'); app.setGlobalPrefix('api/v1', { exclude: ['health'] });
// 启用CORS // 启用CORS
app.enableCors({ app.enableCors({

View File

@ -19,7 +19,7 @@ async function bootstrap() {
credentials: true, credentials: true,
}); });
app.setGlobalPrefix('api/v1'); app.setGlobalPrefix('api/v1', { exclude: ['health'] });
const configService = app.get(ConfigService); const configService = app.get(ConfigService);
const port = configService.get<number>('PAYMENT_SERVICE_PORT') || 3004; const port = configService.get<number>('PAYMENT_SERVICE_PORT') || 3004;

View File

@ -19,7 +19,7 @@ async function bootstrap() {
credentials: true, credentials: true,
}); });
app.setGlobalPrefix('api/v1'); app.setGlobalPrefix('api/v1', { exclude: ['health'] });
const configService = app.get(ConfigService); const configService = app.get(ConfigService);
const port = configService.get<number>('USER_SERVICE_PORT') || 3001; const port = configService.get<number>('USER_SERVICE_PORT') || 3001;