git ssb

0+

gb / gwenbell.com



Tree: a8e5de96fd2a5b9ece705e921bdb70251a14d8c8

Files: a8e5de96fd2a5b9ece705e921bdb70251a14d8c8 / index.js

915 bytesRaw
1var express = require('express');
2var nm = require('nodemailer');
3var bodyParser = require('body-parser');
4
5var app = express();
6app.set('view engine', 'jade');
7app.set('views', './layouts');
8
9app.use(bodyParser.json());
10app.use(bodyParser.urlencoded({extended: true}));
11
12app.post('/send', function (req, res) {
13 var name = req.body.nombre;
14 var email = req.body.elmail;
15 var website = req.body.siteurl;
16 var date = moment().format('MMMM D, YYYY');
17 var str = name + " <" + email + "> " + website + " - " + date;
18
19 var transporter = nm.createTransport();
20
21 transporter.sendMail({
22 from: email,
23 to: 'gwen@gwenbell.com',
24 subject: 'New signup!',
25 text: str
26 });
27 res.redirect('http://gwenbell.com/');
28});
29
30app.use(express.static('./../books/build'))
31app.use(express.static('/static/reserva'))
32app.use(express.static('build'))
33
34app.listen(80);
35console.log('Listening at http://localhost:80/');
36

Built with git-ssb-web