Skip to content

Commit

Permalink
chore: update router
Browse files Browse the repository at this point in the history
  • Loading branch information
nhsz committed Apr 13, 2020
1 parent 790510e commit 4ac6df2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,5 @@ dist
.yarn/unplugged
.yarn/build-state.yml
.pnp.*

.now
8 changes: 4 additions & 4 deletions routes/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
const express = require('express');
const cors = require('cors');
const sendEmail = require('../api/mail');
const sendReceivedPaymentEmail = require('../api/mail');

const router = express.Router();

router.all('*', cors());

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

router.get('/', (req, res) => {
sendEmail();
res.end();
router.post('/payments', (req, res) => {
sendReceivedPaymentEmail(req.body);
res.json(req.body);
});

module.exports = router;

0 comments on commit 4ac6df2

Please sign in to comment.