From 2aa144d4b9f56e21d86f6f15ad7e78964f9297a0 Mon Sep 17 00:00:00 2001 From: Vasanth V Date: Wed, 2 Oct 2019 20:45:14 +0530 Subject: [PATCH] Added a status code 500 for generic error message. --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 0543cea..b24b4ca 100644 --- a/server.js +++ b/server.js @@ -25,11 +25,11 @@ app.get('/about', (req, res) => { app.use(apiRoutes); app.use((err, req, res) => { - res.send({ + res.status(500).send({ ok: false, error: 'Unexpected server error', }); }) app.listen(port); -console.log(`Serving at http://localhost:${port}`); \ No newline at end of file +console.log(`Serving at http://localhost:${port}`);