const mongoose = require('mongoose');

const connectDB = async () => {
    try {
        await mongoose.connect(process.env.MONGO_URI);
        console.log('MongoDB muvaffaqiyatli ulandi...');
    } catch (error) {
        console.error('Xatolik:', error.message);
        process.exit(1);
    }
};

module.exports = connectDB;