From 24fe1ff533609862ba51ea7228fba5fbcc559a3e Mon Sep 17 00:00:00 2001 From: Ahzem <123859613+Ahzem@users.noreply.github.com> Date: Mon, 16 Dec 2024 17:08:28 +0530 Subject: [PATCH] Refactor server initialization; remove commented code and streamline MongoDB connection handling --- server/index.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/server/index.js b/server/index.js index cf24dc0..f212c10 100644 --- a/server/index.js +++ b/server/index.js @@ -45,13 +45,11 @@ app.use(express.json()); app.use(helmet()); app.use(morgan('dev')); -// Routes app.use('/api/auth', authRoutes); app.use('/api/subscriptions', subscriptionRoutes); app.use('/api/reminders', reminderRoutes); app.use('/api/users', userRoutes); -// MongoDB connection try { await mongoose.connect(process.env.MONGODB_URI); console.log('Connected to MongoDB successfully'); @@ -60,7 +58,6 @@ try { process.exit(1); } -// Start server app.listen(PORT, () => { console.log(`Server running on port ${PORT}`); }); \ No newline at end of file