PopcornPing / backend /config /database.js
Yash Goyal
Correction
2070fe3
raw
history blame contribute delete
319 Bytes
const mongoose = require('mongoose');
const connectDB = async () => {
try {
await mongoose.connect(process.env.MONGODB_URI);
console.log('MongoDB Connected Successfully');
} catch (error) {
console.error('MongoDB Connection Error:', error);
process.exit(1);
}
};
module.exports = connectDB;