Skip to content

Commit

Permalink
Refactor server initialization; remove commented code and streamline …
Browse files Browse the repository at this point in the history
…MongoDB connection handling
  • Loading branch information
Ahzem committed Dec 16, 2024
1 parent b74c113 commit 24fe1ff
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -60,7 +58,6 @@ try {
process.exit(1);
}

// Start server
app.listen(PORT, () => {
console.log(`Server running on port ${PORT}`);
});

0 comments on commit 24fe1ff

Please sign in to comment.