Created
January 18, 2012 15:56
-
-
Save mikevalstar/1633706 to your computer and use it in GitHub Desktop.
App.js changed for tutorial project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var error = require('./lib/ErrorHandler'); | |
app.configure('development', function(){ | |
//app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); | |
app.use(error({ showMessage: true, dumpExceptions: true, showStack: true, logErrors: __dirname + '/log/error_log' })); | |
}); | |
app.configure('production', function(){ | |
//app.use(express.errorHandler()); | |
app.use(error()); | |
}); | |
/* ... */ | |
// Example error pages | |
app.get('/ErrorExample', function(req, res, next){ | |
next(new Error('keyboard cat!')); // trigger an error | |
}); | |
app.get('/ErrorExample2', function(req, res){ | |
res.render('404.jade'); // force an error.. we did not set the title | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment