I'm currently developing an Ionic App that fetches from an external API. Because this API is also developed by myself, everything is local. The API returns a JSON array.
My current controller looks like following:
app.controller('ListController', ['$scope', '$http', function($scope, $http){
$http.get('http://localhost:8080/api/getPoi/merzouga').success(function(data){
$scope.pois = data;
});
}]);
The problem is that when I try to load this into my view I get the following error:
XMLHttpRequest cannot load http://localhost:8080/api/getPoi/merzouga. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access.
I don't know if it is relevant, but Ionic is being served on port 8100 and the API on 8080.
Any idea on how can I test this locally?