Untitled
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();