const mongoose = require("mongoose");
require("dotenv").config();

const connectDB = async () =>{
    try {
        await mongoose.connect(process.env.Mongo_URI);
        // await mongoose.connect(process.env.Mongo_URI, {
        //     useNewUrlParser: true,
        //     useUnifiedTopology: true,
        // });
        console.log("MongoDB is Connected!");
    } catch (error) {
        console.log("Having Errors Connecting DB :", error);
    }
};

module.exports = connectDB;