add more debug tools, and email me on error

This commit is contained in:
Tyler Renelle
2013-02-06 02:42:48 -05:00
parent a0c4480c53
commit 0e6d08e16b
5 changed files with 53 additions and 15 deletions

View File

@@ -1,6 +1,38 @@
/*process.on('uncaughtException', function (error) {
process.on('uncaughtException', function (error) {
function sendEmail(mailData) {
var nodemailer = require("derby-auth/node_modules/nodemailer");
// create reusable transport method (opens pool of SMTP connections)
// TODO derby-auth isn't currently configurable here, if you need customizations please send pull request
var smtpTransport = nodemailer.createTransport("SMTP",{
service: process.env.SMTP_SERVICE,
auth: {
user: process.env.SMTP_USER,
pass: process.env.SMTP_PASS
}
});
// send mail with defined transport object
smtpTransport.sendMail(mailData, function(error, response){
if(error){
console.log(error);
}else{
console.log("Message sent: " + response.message);
}
smtpTransport.close(); // shut down the connection pool, no more messages
});
}
sendEmail({
from: "HabitRPG <admin@habitrpg.com>",
to: "tylerrenelle@gmail.com",
subject: "HabitRPG Error",
text: error.stack
});
console.log(error.stack);
});*/
});
require('coffee-script') // remove intermediate compilation requirement
require('./src/server').listen(process.env.PORT || 3000);