I would like to know how to redirect to a standard error page, such as a "not-found" page when an error of type Can not GET / route1 / page2 / 18
I need to, when the user tries to access a page like the one above and is not accessible through the get method, it redirects to a page explaining the error.
I believe it is through Middleware, because it has errors.js in the file some functions like:
exports.notfound = function(req,res,next){
res.status(404);
res.render('not-found');
};
Thank you.