Skip to content

Commit 0d54ff7

Browse files
committed
백엔드 cors 헤더 설정
1 parent 8c28e73 commit 0d54ff7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/backend/src/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ async function bootstrap() {
88
app.enableCors({
99
origin: [process.env.CLIENT_ENDPOINT],
1010
credentials: true,
11-
allowedHeaders: ['Content-Type', 'Apollo-Require-Preflight'],
11+
methods: ['GET', 'HEAD', 'PUT', 'PATCH', 'POST', 'DELETE', 'OPTIONS'],
12+
allowedHeaders: [
13+
'Content-Type',
14+
'Accept',
15+
'Authorization',
16+
'Apollo-Require-Preflight',
17+
],
18+
exposedHeaders: ['Access-Control-Allow-Origin'],
1219
});
1320

1421
await app.listen(process.env.PORT ?? 3001);

0 commit comments

Comments
 (0)