I am trying to play around with an api on my local machine. I currently have a grunt server running on my localhost:9000 for my development environment and I'm trying to call out to seismi's api for fun to play around with some data like so:
$http.get('http://www.seismi.org/api/eqs/2011/03?min_magnitude=6').
success(function(data, status, headers, config) {
$scope.seismiData = data;
console.log($scope.seismiData);
}).
error(function(data, status, headers, config) {
console.log("error with initial fetch");
});
This is just using the example on the page- http://www.seismi.org/api/ . When I do this my console is giving me back this.
XMLHttpRequest cannot load http://www.seismi.org/api/eqs/2011/03?min_magnitude=6. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:9000' is therefore not allowed access.
I'm still pretty new to this so I'm not sure how to get around this so I can use the api's returned json.If someone could point me in the right direction I would greatly appreciate it. Thanks!
chrome.exe --args --disable-web-security