pablocattaneo
10/11/2019 - 10:34 AM

How to manage a 404 page in Express?

app.use((req, res, next) => {

 res.status(404).send('<h1>404!! Page not found</h1>');

})

// Note that there is not path and the status method that define the status code of the respond.