Commit f4610f17 authored by ChakshuGautam's avatar ChakshuGautam
Browse files

fix(cors): remove older cors and add it part of nestfactory

Showing with 6 additions and 6 deletions
+6 -6
......@@ -4,7 +4,7 @@ import { AppModule } from './app.module';
import { NestFactory } from '@nestjs/core';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create(AppModule, { cors: true });
const config = new DocumentBuilder()
.setTitle('e-Samwad User Service')
......@@ -14,11 +14,11 @@ async function bootstrap() {
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, document);
app.enableCors({
origin: '*',
methods: 'GET, PUT, POST, DELETE, PATCH, OPTIONS',
allowedHeaders: 'Content-Type, Authorization',
});
// app.enableCors({
// origin: '*',
// methods: 'GET, PUT, POST, DELETE, PATCH, OPTIONS',
// allowedHeaders: 'Content-Type, Authorization',
// });
await app.listen(3000);
}
bootstrap();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment