aboutsummaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'app.js')
-rw-r--r--app.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/app.js b/app.js
index 8d97dc8..4ef362e 100644
--- a/app.js
+++ b/app.js
@@ -77,7 +77,7 @@ app.use('/', routes);
/* Handle error page */
app.use(function(req, res, next){
- res.status(404 || 500);
+ res.status(404);
// respond with html page
if (req.accepts('html')) {
@@ -90,5 +90,12 @@ app.use(function(req, res, next){
});
+app.use(function(error, req, res, next) {
+ res.status(500);
+ url = req.url;
+ res.render('error', {error: error, url: url});
+});
+
+
module.exports = app;