this is my code which is getting an JSON from post request I have connected the database in other file and it is getting connected when I send data from JSON empty object getting printedd
const express=require('express');
const app =new express()
const User=require('../2-mongoose/3-user')
require('../2-mongoose/1-basic');// have to add this ccompulsory
app.use(express.json())// will convert string into obj
app.post('/users',(req,res)=>{
console.log(req.body);// to console.log data sent through json
res.send("testing");
// const user=new User(req.body);
// user.save().then(()=>{
// res.send(user);
// }).catch((error)=>{
// res.status(400).send(error);
// })
})
app.listen(8000,()=>{
console.log("server fired off");
})