Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to test from localhost website? #152

Closed
bennycode opened this issue Jan 14, 2019 · 4 comments
Closed

How to test from localhost website? #152

bennycode opened this issue Jan 14, 2019 · 4 comments
Labels

Comments

@bennycode
Copy link
Contributor

I bundled 'binance-api-node' and tried to use it within a website but whenever I do a request, I am receiving the following error:

Access to fetch at 'https://api.binance.com/api/v1/time' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled

@balthazar
Copy link
Member

CORS are not really due to the lib but how their API is setup, the only way to get around that is to setup your own proxy server for the API

@bennycode
Copy link
Contributor Author

I tried to run Chrome with --disable-web-security to bypass the need of a Proxy server but it didn't work.

Would you accept a PR that informs about the CORS issue in the README.md? In another issue you pointed out that the library must be Browser-compatible but with the CORS issue this seem to become less of importance?

@balthazar
Copy link
Member

Yeah CORS definitely make the browser support less interesting. About the readme even if I find it a bit out of scope I won't reject a PR

@SrBrahma
Copy link
Contributor

I answered my solution here: #37 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants