Guest User

Untitled

a guest
Jun 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. let endpoint = function(app) {
  2. app.post('/send-mail', function(req, res) {
  3. sgMail.setApiKey(process.env.VUE_APP_APIKEY);
  4. sgMail
  5. .send(req.body)
  6. .then(() => {
  7. // do something
  8. })
  9. .catch(error => {
  10. // do something
  11. });
  12.  
  13. return res.send(req.body);
  14. });
  15. };
  16.  
  17. MY_VAR=my_value node server.js
  18.  
  19. VUE_APP_APIKEY=[API KEY VALUE]
  20.  
  21. require('dotenv').config()
Add Comment
Please, Sign In to add comment