diff --git a/backend/src/main.ts b/backend/src/main.ts index e03661f..5cd16d1 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -1,14 +1,15 @@ import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; -const corsOptions = { - origin: 'https://blog.anatid.net', - methods: 'GET,POST,PATCH,DELETE,OPTIONS', - optionsSuccessStatus: 200 -}; async function bootstrap() { const app = await NestFactory.create(AppModule); - app.enableCors(corsOptions); + app.enableCors({ + origin: ['https://blog.anatid.net'], + methods: 'GET,HEAD,PUT,PATCH,POST,DELETE', + credentials: true, + allowedHeaders: 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept, Observe', // Allowed headers + }); + await app.listen(process.env.PORT ?? 3000); }