Add production and development mode

This commit is contained in:
Paul van Tilburg 2012-01-16 11:34:19 +01:00
parent 40e987c7a5
commit 7dd854161d
1 changed files with 10 additions and 1 deletions

11
app.js
View File

@ -36,9 +36,17 @@ app.configure(function() {
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
});
app.configure('development', function(){
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
app.configure('production', function(){
app.use(express.errorHandler());
});
// Server the main index file statically for now.
app.get('/', function(req, res) {
res.redirect('/index.html');
@ -182,4 +190,5 @@ process.on('SIGTERM', function() { db.save(draggables); process.exit(0); });
// Start the application.
app.listen(3300);
console.log('Plemp! started on http://127.0.0.1:%d/', app.address().port)
console.log('Plemp! started on http://127.0.0.1:%d/ in %s mode',
app.address().port, app.settings.env)