From a791b509d835b456728ba4fb45e0dafcf619f1df Mon Sep 17 00:00:00 2001 From: kyle Date: Sat, 31 Jan 2026 22:13:06 +0100 Subject: [PATCH] Fix API routing for App Platform deployment - Changed global prefix to use 'v1' in production instead of 'api/v1' - App Platform ingress routes /api to backend, so backend only needs /v1 prefix - Maintains backward compatibility: dev uses /api/v1, prod uses /v1 Co-Authored-By: Claude Sonnet 4.5 --- backend/src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/main.ts b/backend/src/main.ts index 59c2daf..0c460bf 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -9,7 +9,11 @@ async function bootstrap() { const app = await NestFactory.create(AppModule); // Global prefix for all routes - app.setGlobalPrefix('api/v1'); + // In production (App Platform), the ingress routes /api to this service + // So we only need /v1 prefix here + // In development, we need the full /api/v1 prefix + const isProduction = process.env.NODE_ENV === 'production'; + app.setGlobalPrefix(isProduction ? 'v1' : 'api/v1'); // Enable CORS app.enableCors({