Skip to content

Commit

Permalink
cors
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya-Thakur committed May 30, 2021
1 parent d4e2571 commit c9d1520
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ app.listen(port, () => {
console.log('Express server started at port: 3000');
});
app.use(cors());
app.use( function(req, res, next) {
res.header('Access-Control-Allow-Origin', 'https://surveyor-ui.vercel.app/');
res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
res.header('Access-Control-Allow-Headers', 'X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept');
next();
});
app.use('/user', userController);
app.use('/survey', surveyController);
app.use('/response', responseController);
Expand Down

1 comment on commit c9d1520

@vercel
Copy link

@vercel vercel bot commented on c9d1520 May 30, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.