mjesuele / gemini-api-node

Node.js client for the Gemini cryptocurrency exchange API
26 stars 17 forks source link

CORS issue when running in browser #7

Open jseils107 opened 6 years ago

jseils107 commented 6 years ago

The API works great for my when running the js file directly in the console. However, when attempting to run via any browser, the private APIs are blocked by what appears to be a CORS issue. Any thoughts on bypassing this error in the browser?

burdakovd commented 6 years ago

You can set up your own proxy server that will send appropriate CORS headers (e.g. allow requests only from your website), and then direct requests to it.

E.g. see how I resolved the same issue for Cryptowatch API: https://github.com/wellsjo/cryptowatch-api/pull/4

mjesuele commented 4 years ago

@burdakovd's solution is similar to something I've done myself, but we've come a long way in the last few years and there might be new ways of handling CORS. I'm refurbishing the package now and can look into it.