InfoAmazonia / rede-site

Rede InfoAmazonia is a platform for water quality sensors
MIT License
9 stars 6 forks source link

Need "Access-Control-Allow-Origin" response header to be "*" for external javascript access of data #71

Closed jywarren closed 8 years ago

jywarren commented 8 years ago

Following up on this discussion where we're having trouble loading your data, it looks like you can just make your response header for "Access-Control-Allow-Origin" to be "*" (wildcard)-- without that, javascript won't be able to access it from another domain. Vitor, would you be able to do that?

The error I currently get is:

XMLHttpRequest cannot load http://rede.infoamazonia.org/api/v1/sensors/560ee510860f948069897de3/measurements/ph.csv. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://jywarren.github.io' is therefore not allowed access.

This will enable Grapherate to read rede.infoamazonia.org data feeds!

vgeorge commented 8 years ago

Hey @jywarren, we've just deployed a fix for that. Let me know if it is working for you.

jywarren commented 8 years ago

It works!

http://jywarren.github.io/grapherate/g/?url=http://rede.infoamazonia.org/api/v1/sensors/560ee510860f948069897de3/measurements/ph.csv On Oct 27, 2015 2:04 PM, "Vitor George" notifications@github.com wrote:

Hey @jywarren https://github.com/jywarren, we've just deployed a fix for that. Let me know if it is working for you.

— Reply to this email directly or view it on GitHub https://github.com/InfoAmazonia/rede-site/issues/71#issuecomment-151589789 .