db.js 207 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 import mongoose from "mongoose"; mongoose.connect(process.env.DB_URL) const db = mongoose.connection; db.on("error",(error)=>console.log("DB Error",error)) db.once("open",()=>console.log("DB is Ready!"))