Skip to content

Commit

Permalink
chore: update cors
Browse files Browse the repository at this point in the history
  • Loading branch information
nhsz committed Apr 14, 2020
1 parent ac96ae8 commit ab8e393
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cors/utils.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const isDev = process.env.NODE_ENV === 'development';
// const isDev = process.env.NODE_ENV === 'development';

const CORS_OPTIONS = {
origin: isDev ? '*' : 'https://undefinedschool.io',
origin: '*',
optionsSuccessStatus: 200 // some legacy browsers (IE11, various SmartTVs) choke on 204
};

Expand Down
11 changes: 7 additions & 4 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@ router.use(cors(CORS_OPTIONS));

router.get('/health', (req, res) => res.sendStatus(200));

router.post('/payments', (req, res) => {
notifyPayment(req.body);
res.json(req.body);
});
router
.route('/payments')
.head((req, res) => res.sendStatus(200))
.post((req, res) => {
notifyPayment(req.body);
res.json(req.body);
});

module.exports = router;

1 comment on commit ab8e393

@vercel
Copy link

@vercel vercel bot commented on ab8e393 Apr 14, 2020

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.