Api GET method


const dbConnect = require('./mongodb');

const app = express();


app.get('/',async(req,res)=>{

   
    let data = await dbConnect();
    data = await data.find().toArray();
    console.log(data);
    res.send(data);

});

app.listen(5000); 

Comments

Popular posts from this blog

React Installation with Vite and Tailwind css (Steps to Installation)

Insert Data In mongoDb

Class methods as an alternative Constructor