ADDED 404 page.
UPDATED to v0.1.1.
This commit is contained in:
5
app.js
5
app.js
@@ -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;
|
||||
|
Reference in New Issue
Block a user