From 4ac6df2efcd89b4cef8500e1c14ae6299a8c4211 Mon Sep 17 00:00:00 2001 From: nhsz Date: Mon, 13 Apr 2020 10:55:20 -0300 Subject: [PATCH] chore: update router --- .gitignore | 2 ++ routes/index.js | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 51c5b10..1a0475b 100644 --- a/.gitignore +++ b/.gitignore @@ -113,3 +113,5 @@ dist .yarn/unplugged .yarn/build-state.yml .pnp.* + +.now \ No newline at end of file diff --git a/routes/index.js b/routes/index.js index adb1de2..13582e6 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,6 +1,6 @@ const express = require('express'); const cors = require('cors'); -const sendEmail = require('../api/mail'); +const sendReceivedPaymentEmail = require('../api/mail'); const router = express.Router(); @@ -8,9 +8,9 @@ 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;