Untitled
unknown
javascript
3 years ago
394 B
18
Indexable
const connection = async()=>{
try{
await mongoose.connect(`mongodb+srv://nikhillende9121:${pass}@cluster1.s0yatl5.mongodb.net/test`);
console.log("connected succesfully");
}catch(error){
console.log("something went wrong while connecting with database",error);
}
}
module.exports={connection};
// app.js
const { connection} = require("./db/conn");
conncetion();Editor is loading...