Skip to content

Commit 1bc1224

Browse files
committed
feat(app): add CORS
1 parent 7d15076 commit 1bc1224

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ async function bootstrap() {
1414
.build();
1515
const document = SwaggerModule.createDocument(app, config);
1616
SwaggerModule.setup('api', app, document);
17-
17+
app.enableCors({
18+
origin: '*',
19+
methods: 'GET, PUT, POST, DELETE',
20+
allowedHeaders: 'Content-Type, Authorization',
21+
});
1822
await app.listen(3000);
1923
}
2024
bootstrap();

0 commit comments

Comments
 (0)