const mongoose = require("mongoose");


const db = async () => {
  try {
    const mongoURI = "mongodb+srv://shihabmoni15_db_user:fnxoOMoTEGHqpECN@cluster0.6ydbfyo.mongodb.net/?appName=Cluster0";
    const res = await mongoose.connect(mongoURI, {
      useNewUrlParser: true, 
      useUnifiedTopology: true, 
    });

    console.log("MongoDB connected successfully");
  } catch (err) {
    console.error("MongoDB connection error:", err);
  }
};
module.exports = db;