diff --git a/src/app.js b/src/app.js index b79f0248..8b43cd82 100644 --- a/src/app.js +++ b/src/app.js @@ -39,9 +39,6 @@ app.use(limiter); // Built-in middleware for parsing JSON app.use(express.json()); -// Database connection -connectDB(); - // Use your routes here app.use("/api/helloworld", helloWorldRouter); @@ -54,6 +51,9 @@ app.use((err, req, res, next) => { }); }); +// Database connection +connectDB(); + app.listen(port, () => { console.log(`${chalk.green.bold("Server")} is listening on port ${port}`); });