Skip to content

Commit

Permalink
use enableCors
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahdigh committed Oct 22, 2023
1 parent 916dc34 commit 4b667ed
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ async function bootstrap() {
};
}
const app = await NestFactory.create(AppModule, { httpsOptions });
// app.enableCors();
// app.useGlobalPipes(new ValidationPipe({ whitelist: true, transform: true }));
app.useGlobalPipes(new ValidationPipe({ transform: true }));
app.use(
Expand All @@ -29,9 +30,24 @@ async function bootstrap() {
'https://pairwise.vote',
'https://pairwise.vote/',
'https://www.pairwise.vote/',
'http://www.pairwise.vote',
'http://pairwise.vote',
'http://pairwise.vote/',
'http://www.pairwise.vote/',
],
}),
);

// app.all('*', function (req, res) {
// res.header('Access-Control-Allow-Origin', '*');
// res.header(
// 'Access-Control-Allow-Headers',
// 'Content-Type,Content-Length, Authorization, Accept,X-Requested-With',
// );
// res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS');
// //...
// });

app.use(cookieParser());

const config = new DocumentBuilder()
Expand Down

0 comments on commit 4b667ed

Please sign in to comment.