Tuesday 9 May 2017

Why do we use req.body while creating any model?

Following some tutorial there comes a code in which req.body is used.Is it a middleware(body-Parser)?can look at my comments where req.body is used.

        Review.create({
        title : req.body.title,  //here it is used!!
        description : req.body.description,
        rating: req.body.rating,
        done : false
    }, function(err, review) {
        if (err)
            res.send(err);

And if it is a third party middleware then how does it functions in the code?



via Aditya Jain

No comments:

Post a Comment