initial commit

This commit is contained in:
Ian 2012-04-04 22:21:56 -07:00
commit 7d2338c378
3 changed files with 67 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.swp
*.swo
*~
node_modules/

50
app.js Normal file
View File

@ -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 <bob@airtext.com>',
// 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);
});

13
package.json Normal file
View File

@ -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"
}