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 <noreply@anthropic.com>
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user