set bodyparser express code example
Example 1: bodyparser purpose
//body-parser helps parse json files
//you can use body-parser anytime you need to use a form to post
//data to a request
var bodyParser = require("body-parser");
app.use(bodyParser.urlencoded({extended: true}));
Example 2: app use body parser
// parse application/json
app.use(bodyParser.json())