0
I’m sending an angular object, but I’m not getting the data on the express Node
method sent with angular.
this.appService.getcheckout(this.post()).subscribe(checkout => {
this.log = this.log+ checkout
});
post(){
return [
{
"path": this.path,
"branchDev": this.branch
}
];
}
attempt on express
var bodyParser = require('body-parser');
app.use(bodyParser.urlencoded({
extended: false
}));
app.post('/checkout', cors(),function (req, res) {
console.log(req.body);
console.log(req.body.path);
)};
console
user@bitter:/var/www/html/gitrun$ node express.js
[ { path: '/var/www/html/gitrun', branchDev: ' git-1' } ]
undefined