Skip to content

Commit

Permalink
feat: enable CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
YutaroNegi committed Dec 1, 2024
1 parent 5d7d2c8 commit 4317d4e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { ValidationPipe } from '@nestjs/common';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.enableCors({
origin: process.env.FRONTEND_URL,
credentials: true,
});
app.use(cookieParser());
app.useGlobalPipes(
new ValidationPipe({
Expand All @@ -13,6 +17,7 @@ async function bootstrap() {
transform: true,
}),
);

await app.listen(process.env.PORT ?? 3000);
}
bootstrap();

0 comments on commit 4317d4e

Please sign in to comment.