commit 7d2338c37871d8bcfedbb99702f2775399e8a391 Author: Ian Date: Wed Apr 4 22:21:56 2012 -0700 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8667649 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.swp +*.swo +*~ +node_modules/ diff --git a/app.js b/app.js new file mode 100644 index 0000000..e57081e --- /dev/null +++ b/app.js @@ -0,0 +1,50 @@ +var express = require('express') + , app = express.createServer() + , nodemailer = require('nodemailer') + +// Express config +app.set('views', __dirname + '/views'); +app.set('view engine', 'jade'); + +app.use(express.cookieParser()); +app.use(express.static(__dirname + '/public')); +app.use(express.bodyParser()); + +// App + +/* Homepage */ +app.get('/', function(req, res) { + res.render('index', { + + }); +}); + + +var transport = nodemailer.createTransport("Sendmail", "/usr/sbin/sendmail"); + +// Message object +var message = { + + // sender info + from: 'Bob ', + + // Comma separated list of recipients + to: '9147727429@vtext.com', + subject: '', + text: 'Hello to myself!', + +}; + +transport.sendMail(message, function(error){ + if(error){ + console.log('Error occured'); + console.log(error.message); + return; + } + console.log('Message sent successfully!'); +}); + +var port = process.env.PORT || 8080; +app.listen(port, function() { + console.log('Listening on', port); +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..46e7f01 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "AirText" + , "dependencies": { + "express": "2.5.2" + , "jade": "0.14.2" + , "nodemailer": "latest" + } + , "devDependencies": { + } + , "main": "app" + , "engines": { "node": ">= 0.4.0" } + , "version": "0.0.1" +}