module.exports = async function (mongoose) { try { await mongoose.connect(process.env.CONNECTION_URI); console.log('✅ MongoDB connected'); } catch (err) { console.error('❌ MongoDB connection error:', err); process.exit(1); } };