import mongoose from 'mongoose'

export const connectDB = async () => {
    try {
        console.log("mongo_uri",process.env.MONGO_URI)
        const connectDataBase = await mongoose.connect(process.env.MONGO_URI)
        console.log(`MongoDB Connected : ${connectDataBase.connection.host}`)
    } catch (error) {
        console.log("Error connection to mongoDb",error.message)
        process.exit(1) //1 is failure , 0 status code is success
    }
}