18 Creating post route handler in node js | React Native tutorial in English

preview_player
Показать описание
In this video we will create post route handler in node js. React Native tutorial in English

connect with me on -
Рекомендации по теме
Комментарии
Автор

The post function can be refactored like this,
app.post('/send-data', async (req, res) => {
const employee = new Employee(req.body)
await employee.save().then(() => console.log(employee))
res.send('Posted')
})
Here I am passing the req.body directly to the Employee model, so that it will take only the fields we specified in the model.

vishnugajulapalli
welcome to shbcf.ru