tracman-server/config/routes/test.js

29 lines
651 B
JavaScript
Raw Normal View History

2017-04-12 11:41:27 -06:00
'use strict';
const router = require('express').Router(),
mw = require('../middleware.js'),
mail = require('../mail.js');
router
2017-04-12 11:41:27 -06:00
.get('/mail', (req,res,next)=>{
mail.send({
to: `"Keith Irwin" <hypergeek14@gmail.com>`,
from: mail.from,
subject: 'Test email',
text: mail.text("Looks like everything's working! "),
html: mail.html("<p>Looks like everything's working! </p>")
}).then(()=>{
console.log("Test email should have sent...");
res.sendStatus(200);
}).catch((err)=>{
mw.throwErr(err,req);
next();
});
})
.get('/password', (req,res)=>{
res.render('password');
});
2017-04-12 11:41:27 -06:00
module.exports = router;