Yes! its possible and easy, first you need these things:
- Express project
- Main file (server.js, index.js etc.)
So after making the project you will see this in your main file:
After that add line!
put this code
app.get("/*", (request, response) => {
response.sendFile(__dirname + "/views/404.html");
});
So β/*β will be the para after your website, this will checks if that para exist or not
if not it will show error
Example:
The 404.html file
Heres the output:
Hope it helps
If it make sure to click button! it will rlly appriciate.