From 3a6f1c07c93548d913e2403a7a0516908156a6cb Mon Sep 17 00:00:00 2001 From: Nishar Miya <103556082+miyannishar@users.noreply.github.com> Date: Sun, 29 Jan 2023 12:19:49 -0500 Subject: [PATCH] Added comment and made a middlware --- app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 8fce368..6638545 100644 --- a/app.js +++ b/app.js @@ -17,6 +17,13 @@ var contactSchema = new mongoose.Schema({ desc: String }); + +// Middleware +app.use((req, res, next)=>{ + res.status(404); +}); + +// Making Model from Schema var Contact = mongoose.model('Contact', contactSchema); // EXPRESS SPECIFIC STUFF @@ -53,4 +60,4 @@ app.post('/contact', (req, res)=>{ // START THE SERVER app.listen(port, ()=>{ console.log(`The application started successfully on port ${port}`); -}); \ No newline at end of file +});