0
I would like to know how to redirect to a standard error page, such as a "not-found" page when a type error occurs Cannot GET /rota1/pagina2/18
I need that 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, as it has in the file errors.js some functions like:
exports.notfound = function(req,res,next){
res.status(404);
res.render('not-found');
};
Thanks.
Are you using express?
– Genos