angularjs - How to fix No 'Access-Control-Allow-Origin' header in Angular -


i trying access strava api , recieve error xmlhttprequest cannot load https://www.strava.com/api/v3/segments/626273/leaderboard?per_page=1&page=1&gender=f&access_token=xxxxx. no 'access-control-allow-origin' header present on requested resource. origin 'https://s3.amazonaws.com' therefore not allowed access.

i can access link directly, not through request.

below code based of off other solutions tried, didn't work. hosting in s3 bucket don't have server side trying solution in angularjs.

app = angular.module('myapp', []);  app.config(['$httpprovider', function($httpprovider){   $httpprovider.defaults.withcredentials = true; }]);  app.controller('myctrl', function($scope, $http) {   $http.get("https://www.strava.com/api/v3/segments/626273/leaderboard?per_page=1&page=1&gender=f&access_token=xxxxx").then(function(response) {       $scope.mywelcome = response.data;   }); }); 


Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -