ibrohm's picture
Initial commit V3.0
16a83e0
raw
history blame contribute delete
397 Bytes
const mongoose = require('mongoose');
const connectDB = async () => {
try {
const conn = await mongoose.connect(process.env.MONGO_URI);
console.log(`MongoDB Connected: ${conn.connection.host}`);
} catch (error) {
console.error(`MongoDB Error: ${error.message}`);
// Don't exit - let server still run for health checks
}
};
module.exports = connectDB;