 import mongoose from 'mongoose';

 export const connectDB = async () => {
    try{
        await mongoose.connect(process.env.MONGO_URI);
        console.log("connected to database");
    }catch(error){
        console.log("failed to connect to databse");
        process.exit(1);
    }
 };