diff options
Diffstat (limited to 'app.js')
| -rw-r--r-- | app.js | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -68,4 +68,20 @@ app.use('/admin', adminRoutes); app.use('/user', userRoutes); app.use('/', routes); + +app.use(function(req, res, next){ + res.status(404 || 500); + + // respond with html page + if (req.accepts('html')) { + res.render('error', { url: req.url }); + return; + } + + // default to plain-text. send() + res.type('txt').send('Not found'); + +}); + + module.exports = app; |
