text: const mongoose = require('mongoose');
  // const db = config.get('mongoURI');
  const db = process.env.MONGO_URI;
  
  const connectDB = async () => {
    try {
      await mongoose.connect(db, {
          useNewUrlParser: true,
          useFindAndModify: true,
          useUnifiedTopology: true,
          useCreateIndex: true,
        }
      );
  
      console.log('MongoDB is successfully connected!');
    } catch (err) {
      console.error(err.message);
      process.exit(1);
    }
  };
  
  module.exports = connectDB;