From 0c769b66c24fa2e98d9b515f3728748913db213e Mon Sep 17 00:00:00 2001 From: NaayoungKwon Date: Wed, 23 Nov 2022 13:16:47 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20cors=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/apps/api/src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/apps/api/src/main.ts b/server/apps/api/src/main.ts index 22661db8..8e5e4cdb 100644 --- a/server/apps/api/src/main.ts +++ b/server/apps/api/src/main.ts @@ -8,7 +8,11 @@ import * as cookieParser from 'cookie-parser'; async function bootstrap() { const app = await NestFactory.create(ApiModule); - app.enableCors(); + app.enableCors({ + origin: true, + methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS', + credentials: true, + }); if (process.env.NODE_ENV == 'prod') { Sentry.init({ dsn: process.env.SENTRY_DSN,