77474/how-to-redirect-404-errors-to-a-page-in-expressjs
Hello @kartik,
You can put a middleware at the last position that throws a NotFound error, or even renders the 404 page directly:
app.use(function(req,res){ res.status(404).render('404.jade'); });
Hope it helps!! Thank You!!
I am trying to append a string to a ...READ MORE
Hello @kartik, Try using an anonymous function instead: expect( ...READ MORE
Hello @kartik, The easiest way I have found ...READ MORE
Hello @kartik, The method is: res.sendStatus(404); Express will send a ...READ MORE
Hey @kartik, First you have to go to ...READ MORE
Named route is used to give specific ...READ MORE
Hello, This is simple you just need to ...READ MORE
Hey @kartik, Named routing is another amazing feature of ...READ MORE
Hello @kartik, To print stacktrace of Error in console in ...READ MORE
Hello @kartik, Use the npm bin command to get the ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.