fix(admin-service): 移除全局前缀排除规则 — 让 app/version 路由正确响应 /api/v1 前缀

Kong 以 strip_path=false 转发 /api/v1/app/version/check,但服务排除了该路径的
全局前缀,导致 404。去掉 exclude 后所有路由统一挂载在 /api/v1 下。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-03 21:39:32 -08:00
parent c6c434a07a
commit 2cf90db0b1
1 changed files with 2 additions and 4 deletions

View File

@ -6,10 +6,8 @@ import { AdminModule } from './admin.module';
async function bootstrap() {
const app = await NestFactory.create(AdminModule);
// Global prefix for admin APIs; mobile client endpoints excluded
app.setGlobalPrefix('api/v1', {
exclude: ['app/version/(.*)'],
});
// Global prefix — applies to all routes including mobile client endpoints
app.setGlobalPrefix('api/v1');
app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));
app.enableCors();