Adam Tretera
03/08/2022, 9:23 AMreq.body
is empty ? after POST call
Is there a best practice for express api project structure ? cannot find any diffrent then all routes in index.tsNurul
03/08/2022, 10:11 AM_.isEmpty(req.body)
This will return true
if req.body is empty.
Another way could be by checking if there are any keys in the object, if there are none then it would mean that the req.body
is empty.
if (Object.keys(req.body).length === 0) {
// Body is empty
}
Adam Tretera
03/08/2022, 12:30 PM"title is missing"
Nurul
03/11/2022, 10:43 AMAdam Tretera
03/12/2022, 11:25 AM