I'm trying to access the data in a POST request however when I console.log(req.body) I'm just getting an empty {}.
I feel like my error is somewhere in the markup?
Here is the relevant client side markup
<div id='create' class="card">
<form method = 'post' action='/'>
<textarea placeholder="Enter your name"></textarea><br>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
relevant backend code
app.use(bodyParser.json());
app.post('/',(req, res)=>{
console.log(req.body);
});
If the user enters "John" in the textarea I'd like the page to refresh and the name John to appear in the terminal.
I plan to export that data to another file that is connected to my mongodb