From ff84dd5d374ce3cc6034010b19696222ed4a0578 Mon Sep 17 00:00:00 2001 From: ABHIRUP Date: Sat, 19 Aug 2023 22:35:11 +0530 Subject: [PATCH] get router added for testing --- backend/server.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/backend/server.js b/backend/server.js index 52890a2..56ddc68 100644 --- a/backend/server.js +++ b/backend/server.js @@ -13,8 +13,6 @@ cloudinary.config({ api_secret: process.env.API_SECRET, }); -connectDB(); - const app = express(); app.use( express.json({ @@ -30,8 +28,17 @@ app.use( }) ); +app.get("/api/v1", (req, res) => res.send('Hello from SCCSE-AOT')); app.use("/api/v1/member", memberRoute); -app.listen(port, () => { - console.log("server is running on " + port); -}); + +connectDB() + .then(() => { + app.listen(port, () => { + console.log("server is running on " + port); + }); + }) + .catch(() => { + console.log("Couldn't start server"); + }) +