10 lines
264 B
JavaScript
10 lines
264 B
JavaScript
// Forward unmatched requests to the shared error-page handler.
|
|
|
|
module.exports = function registerNotFoundHandler(app) {
|
|
app.use(function (_req, _res, next) {
|
|
const error = new Error('Page not found.');
|
|
error.statusCode = 404;
|
|
next(error);
|
|
});
|
|
};
|