diff --git a/apps/server/src/main.ts b/apps/server/src/main.ts index 8954ea3..299352e 100644 --- a/apps/server/src/main.ts +++ b/apps/server/src/main.ts @@ -6,7 +6,7 @@ import mongoose from 'mongoose'; import { ORIGINS } from './shared/origins'; async function bootstrap() { - const app = await NestFactory.create(AppModule, {logger: ['error', 'warn', 'log','fatal']}); + const app = await NestFactory.create(AppModule, {logger: ['error', 'warn', 'log','fatal'], cors: true}); app.useGlobalPipes(new ValidationPipe({ whitelist: true, forbidNonWhitelisted: true, @@ -20,12 +20,7 @@ async function bootstrap() { return new BadRequestException(result); }, })); - app.enableCors({ - origin: ORIGINS, - methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'], - allowedHeaders: ['Content-Type', 'Authorization'], - credentials: true, - }); + app.enableCors(); const globalPrefix = 'api/v1'; app.setGlobalPrefix(globalPrefix);