From e7a9cbe582a74a8ba8d27f475b6576fa9e633b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=B4=D8=B1=D9=81=20=D8=A7=D9=84=D8=AF=D9=8A=D9=86?= <83120892+isasharafdin@users.noreply.github.com> Date: Mon, 29 Apr 2024 05:15:59 +0300 Subject: [PATCH] Update app.js --- src/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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}`); });