I don't understand why I cannot get the data I POST form with Angular.js Express.
Angular Part :
$http.post(baseURL+"/search", data).success(function(data, status) {
$scope.results = data;
});
Express Part :
app.use(bodyParser.urlencoded({ extended: false }));
app.post('/search', function(req, res){
console.log(req.query, req.body, req.params);
});
The log is {} {} {}. I can't figure out what am I doing wrong.
I also tried :
$http({
method: "POST",
url : baseURL+"/search",
data : {name: 'tete'},
headers: {'Content-Type': 'application/json'}
}).success( function(data){
console.log(data);
});
It doesn't work too.