const mongoose = require(“mongoose”);
require(“dotenv”).config;
const dbConnect = () => {
mongoose.connect(process.env.DATABASE_URL,{
})
.then(() => console.log("DB ka connection is Done"))
.catch((error)=>{
console.log("Issue in DBConnection");
console.error(error.message);
process.exit(1);
});
}
module.exports = dbConnect;
I was trying to connect my server to mongobd and it is successfully connected but it does not made my
database
New contributor
Harsh Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.