ADDED 404 page.

UPDATED to v0.1.1.
This commit is contained in:
Eric Woodward
2018-01-07 22:06:06 -05:00
committed by Eric Woodward
parent 096e3b8404
commit 3f948c9c20
3 changed files with 169 additions and 5 deletions

5
app.js
View File

@@ -51,9 +51,7 @@ app.use('/search/', search);
/// catch 404 and forwarding to error handler
app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
res.status(404).sendFile(path.join(__dirname + '/public/errors', '404.html'));
});
/// error handlers
@@ -81,4 +79,5 @@ app.use(function(err, req, res, next) {
});
module.exports = app;