Skip to content

Commit 096d5d5

Browse files
committed
Fix app initialization order
1 parent bfb91fb commit 096d5d5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

backend/dist/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ const content_route_1 = __importDefault(require("./Routes/content.route"));
1313
const brain_route_1 = __importDefault(require("./Routes/brain.route"));
1414
const PORT = process.env.PORT || 5000;
1515

16-
app.listen(PORT, () => {
17-
console.log(`Server running on port ${PORT}`);
18-
});
16+
1917

2018

2119

@@ -24,6 +22,9 @@ const app = (0, express_1.default)();
2422
app.use(cors());
2523
mongoose.connect(process.env.MONGODB_URI);
2624
mongoose.then(() => console.log("MongoDB Connected Successfully"))
25+
app.listen(PORT, () => {
26+
console.log(`Server running on port ${PORT}`);
27+
});
2728
mongoose.catch(err => console.log("MongoDB Error:", err));
2829
app.use(express_1.default.json());
2930
app.use("/api/v1/auth", auth_route_1.default);

0 commit comments

Comments
 (0)