Method POST with Handlebars Express Mongodb

Method POST with Handlebars Express Mongodb
0.0 0


I have a problem, my code does not work, it does not take the data I pass it'/', (req, res) =>{
var photo = new Photo(req.body);

    }).catch((err) => {
        res.status(400).send('Unable to save Photo');
<form action="/" method="POST">
            <div class="form-group">
                <label>Title Photo</label>
                <input type="text" class="form-control" name="title" placeholder="Title">
             <div class="form-group">
                <input type="text" class="form-control" name="image" placeholder="Link Photo">

            <button type="submit" class="btn btn-primary">Submit</button>

with Postman I can send the data, but no with the form, what is the problem

use Express, Mongodb and Handlebars

please help me


Resolved: I forget to put app.use(bodyParser.urlencoded({ extended: true }));