Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

redirect to 404 page in node js express

app.use(function (req, res) {
    res.status(404).sendFile(path.join(__dirname, "/views/error404.html"));
  })
 
PREVIOUS NEXT
Tagged: #redirect #page #node #js #express
ADD COMMENT
Topic
Name
5+3 =