Search code examples
angularjscorsappveyor

Getting CORS error from appveyor rest api using angular


I'm writing an angular app that makes a GET request via $http service to AppVeyor REST API to get my project last build status and I'm getting a CORS error.

When I try from Fiddler it works.

var buildStatus= 'https://ci.appveyor.com/api/projects/accountName/projectSlug';
var token = 'q3245dsfg'; // my account api token

$http.get(buildStatus, {
    headers: {
        'Authorization': 'Bearer ' + token
    }
 }).then(...

This is the error I'm getting on Firefox:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://ci.appveyor.com/api/projects/accountName/projectSlug. (Reason: CORS request failed).

Any ideas?


Solution

  • I'm making the request from my Node.js server to AppVeyor and forwarding the response back to my angular app.