Skip to content

Commit

Permalink
Add error message for 404
Browse files Browse the repository at this point in the history
  • Loading branch information
KostaSav committed May 28, 2024
1 parent 80f5654 commit a3cf3cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ app.set("port", (process.env.PORT || 5000));
app.listen(app.get("port"), function() {
console.log("Node app is running on port", app.get("port"));
});

app.use((req, res, next) => {
res.status(404).send("Sorry can't find that!")
})

0 comments on commit a3cf3cd

Please sign in to comment.