From 189c183337cf3281056d313c4724536e450a46fd Mon Sep 17 00:00:00 2001 From: HumairAK Date: Wed, 27 Jul 2016 14:02:13 -0400 Subject: fixed tests to work again, added db connectivity, moved dbtests folder out so as not to interfere with mocha recursive search --- app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app.js') diff --git a/app.js b/app.js index b0008a3..1bf49f7 100644 --- a/app.js +++ b/app.js @@ -73,7 +73,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')) { @@ -86,5 +86,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; -- cgit v1.2.3