Created
October 19, 2019 10:05
-
-
Save alexandermckay/781da89b9bb52957504ac6c8e528a0a6 to your computer and use it in GitHub Desktop.
cors.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cors = require('cors'); | |
const corsHandler = cors({ origin: true }); | |
/* Your other code */ | |
const handleEmail = (req, res) => { | |
corsHandler(req, res, () => { | |
transporter.sendMail(mailOptions(req.query), transport); | |
}); | |
res.send({ status: 200 }); | |
}; | |
module.exports = https.onRequest(handleEmail); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment