From 7192cda20feab7fcf7934d47df98bc0863f4eccb Mon Sep 17 00:00:00 2001 From: Yaosanqi137 Date: Sun, 5 Apr 2026 14:30:13 +0800 Subject: [PATCH] fix(api): enable CORS for browser client requests --- apps/api/src/main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index c7aef94..3f891f4 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -5,6 +5,10 @@ import { AppModule } from "./app.module"; async function bootstrap(): Promise { const app = await NestFactory.create(AppModule); + app.enableCors({ + origin: true, + credentials: true + }); app.useGlobalPipes( new ValidationPipe({ transform: true,