Skip to content

Commit f4610f1

Browse files
committed
fix(cors): remove older cors and add it part of nestfactory
1 parent 5d401ae commit f4610f1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/main.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AppModule } from './app.module';
44
import { NestFactory } from '@nestjs/core';
55

66
async function bootstrap() {
7-
const app = await NestFactory.create(AppModule);
7+
const app = await NestFactory.create(AppModule, { cors: true });
88

99
const config = new DocumentBuilder()
1010
.setTitle('e-Samwad User Service')
@@ -14,11 +14,11 @@ async function bootstrap() {
1414
.build();
1515
const document = SwaggerModule.createDocument(app, config);
1616
SwaggerModule.setup('api', app, document);
17-
app.enableCors({
18-
origin: '*',
19-
methods: 'GET, PUT, POST, DELETE, PATCH, OPTIONS',
20-
allowedHeaders: 'Content-Type, Authorization',
21-
});
17+
// app.enableCors({
18+
// origin: '*',
19+
// methods: 'GET, PUT, POST, DELETE, PATCH, OPTIONS',
20+
// allowedHeaders: 'Content-Type, Authorization',
21+
// });
2222
await app.listen(3000);
2323
}
2424
bootstrap();

0 commit comments

Comments
 (0)