I am using node, express, html and i am trying to post a to my server side using a html form. The problem is I get {} as my req.body.
My html form is the following:
<form method = 'post' action='get_name' enctype="multipart/form-data">
<input type="text" name="form_name"><br>
<input type="submit" value="Upload name">
</form>
I use the following in the begining of the my node.js file:
app.use(bodyParser.urlencoded({limit:'5mb', extended:false}));
app.use(busboy());
My app.post is the following:
app.post('/get_name',function(req, res, next){
console.log("the name of the form is : ", req.body);
res.redirect('/admin');
});
When i am trying to get req.body.form_name I get undefined. I cant find out what is wrong with my code. Any suggestions are welcome. :)