const mongoose = require("mongoose");

// Test
const connectDB = async () => {
  try {
    await mongoose.connect(process.env.DB_URI);

    console.log("MongoDB connected");
  } catch (error) {
    console.error("MongoDB connection error:", error);
    process.exit(1);
  }
};

module.exports = connectDB;
