tdickman / crypto51

https://www.crypto51.app/
GNU General Public License v3.0
77 stars 34 forks source link

Add CORS header to coins.json #37

Closed lukechilds closed 5 years ago

lukechilds commented 5 years ago

The coins.json endpoint can't be accessed from a browser because it doesn't have a CORS header. Add a Access-Control-Allow-Origin: * header will resolve the issue and allow the data to be consumed by browsers.

tdickman commented 5 years ago

I'll take a look into the best way to do this. The site is currently hosted on s3, so I should be able to follow something like this to enable CORS for the coins.json file.

lukechilds commented 5 years ago

@tdickman Did you get anywhere with this?

I'm currently accessing the API via: https://cors.io/?https://www.crypto51.app/coins.json

But it's pretty slow, doesn't make use of caching and could die at any point.

tdickman commented 5 years ago

@lukechilds I just pushed up some new changes to add an api. subdomain with cors headers enabled. You should be able to use this url now:

https://api.crypto51.app/coins.json

lukechilds commented 5 years ago

Perfect, thanks!