If you are starting new with Node JS, you will probably face this problem, while submitting the form to a post URL.
The problem you will face is getting an empty req.body
despite sending the form properly. To resolve this issue, you have to make two changes to your current system.
Add the following to the form element
enctype="application/x-www-form-urlencoded"
However, if you do not add this it will still work as this is the default for a form.
The second thing, in your index.js
in the root, add the following lines to enable the form.
app.use(express.urlencoded({
extended: true
}));
This is it, now you will be able to receive the form data in req.body
If you are facing the same issue for the JSON inputs in your API calls, please check the link here to enable it.