text: const mongoose = require('mongoose');
  require('dotenv').config();
  
  const MONGO_URI = process.env.MONGO_URI;
  
  const connectDB = async () => {
    try {
      await mongoose.connect(MONGO_URI, {
        useNewUrlParser: true,
        useCreateIndex: true,
        useFindAndModify: false,
        useUnifiedTopology: true,
      });
      console.log('DB connected..');
    } catch (error) {
      console.log(error.message);
      process.exit(1);
    }
  };
  
  module.exports = connectDB;
  