JavaScript is required to use Bungie.net

Help

Help us help you.
originally posted in:BungieNetPlatform
8/13/2015 12:08:32 PM
3

CORS & API key: anyone found a fix?

Hey guys, I was reworking my AngularJS project that fetches my destiny info to contain my api key. however, adding this custom header seems to break my app. I've been forced to use a proxy service (was using http://crossorigin.me/ but tried heruko as well) so my app can run flawless, however, as soon as I include my api key header i'm running into the CORS issue again since neither services seem to forward my custom header (or when i include my custom header they seem to not include their own CORS headers). Anyone else stumble onto this issue? able to get past it? If not I guess I'll have to see if i can setup another fix for the issue. just wanted to keep with angularJS for learning purposes for myself :)
English
#Help

Posting in language:

 

Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

View Entire Topic
  • We actually run our app on Angular and Heroku so hopefully I can help. For local development we use the livereload proxy [url]https://github.com/SteffanLong/DestinyTrialsReport/blob/master/Gruntfile.js#L282[/url] Its set up so if we send a request to our app at [b]/bungie/Destiny/SearchDestinyPlayer/1/Deej%20BNG/[/b] the proxy rewrites that to [b]http://bungie.net/Platform/Destiny/SearchDestinyPlayer/1/Deej%20BNG/[/b] for Heroku we write the server.js in the gruntfile [url]https://github.com/SteffanLong/DestinyTrialsReport/blob/master/Gruntfile.js#L93[/url] which ends up looking like this [url]https://gist.github.com/v-fedorov/1b06cb360fa72d2a08ed#file-server-js-L38[/url]. You would need to set the API key as a Heroku env variable [b]BUNGIE_API[/b]

    Posting in language:

     

    Play nice. Take a minute to review our Code of Conduct before submitting your post. Cancel Edit Create Fireteam Post

    2 Replies
    You are not allowed to view this content.
    ;
    preload icon
    preload icon
    preload icon