mongoose.connect(process.env.MONGO_URI).then(() => { console.log("DB Connected"); }); mongoose.connection.on("error", err => { console.log(`DB Connection Error: ${err.message}`); });