diff options
| author | HumairAK <humair88@hotmail.com> | 2016-07-26 07:43:04 +0000 |
|---|---|---|
| committer | HumairAK <humair88@hotmail.com> | 2016-07-26 07:43:04 +0000 |
| commit | f016bdbc35b7efa44bd63413bde09433ea916c59 (patch) | |
| tree | 238a4ffbd447907876b2f1624cdb6f4abc3009eb /app.js | |
| parent | 10f1c442e27d82d1fc2c94d1bc0a2ad27917b287 (diff) | |
added some unit testing, need a lot more
Diffstat (limited to 'app.js')
| -rw-r--r-- | app.js | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -67,4 +67,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; |
