diff --git a/app.js b/app.js index 8fce368..a7000cf 100644 --- a/app.js +++ b/app.js @@ -50,6 +50,11 @@ app.post('/contact', (req, res)=>{ // res.status(200).render('contact.pug'); }) +// Handling 404 error +app.use((req, res, next) =>{ + res.status(404).send("404 error ! Page not found") +}) + // START THE SERVER app.listen(port, ()=>{ console.log(`The application started successfully on port ${port}`); diff --git a/package.json b/package.json index 3bb3134..1de78aa 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "description": "This is a website for a popular dance academy", "main": "app.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node app" }, "author": "Harry bhai", "license": "ISC",