update cors
This commit is contained in:
@@ -4,8 +4,10 @@ import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
|
||||
const corsOrigin = (process.env.CORS_ORIGIN ?? '').split(','); // split by comma to array
|
||||
app.enableCors({
|
||||
origin: process.env.CORS_ORIGIN,
|
||||
origin: corsOrigin,
|
||||
methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],
|
||||
allowedHeaders: ['Content-Type', 'Authorization'],
|
||||
credentials: true,
|
||||
|
||||
Reference in New Issue
Block a user