експресна поща
app.post('/signup', async(req, res) => {
const { email, firstName } = req.body
const user = new User({ email, firstName })
const ret = await user.save()
res.json(ret)
})
начин експрес-изпращане на
fetch('',{
method:'POST',
headers:{
'content-type': 'application/json'
},
body:JSON.stringify(users)
})
.then(res=> res.json())
.then(data => console.log(data))