var express = require('express'); var nm = require('nodemailer'); var bodyParser = require('body-parser'); var app = express(); app.set('view engine', 'jade'); app.set('views', './layouts'); app.use(bodyParser.json()); app.use(bodyParser.urlencoded({extended: true})); app.post('/send', function (req, res) { var name = req.body.nombre; var email = req.body.elmail; var website = req.body.siteurl; var date = moment().format('MMMM D, YYYY'); var str = name + " <" + email + "> " + website + " - " + date; var transporter = nm.createTransport(); transporter.sendMail({ from: email, to: 'gwen@gwenbell.com', subject: 'New signup!', text: str }); res.redirect('http://gwenbell.com/'); }); app.use(express.static('./../books/build')) app.use(express.static('/static/reserva')) app.use(express.static('build')) app.listen(80); console.log('Listening at http://localhost:80/');