artii-api
artii-api copied to clipboard
Enable CORS?
First off, I love your service! Would it be possible to allow cross origin requests?
When I try and access http://artii.herokuapp.com/make?Hi
from a web application, I get the following error:
XMLHttpRequest cannot load http://artii.herokuapp.com/make?Hi. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access.
I'm not trying to use your API for production use, just for some web development training and tinkering.
Yes, I think you can't make XHR requests against this API, I don't think it would be hard to support cross origin requests, but I won't be able to do it in the near future.
If you need it right now I'd suggest to create a proxy server to consume this API.
You could also add this feature by submitting a PR to speed up the process.
Sorry, I don't really have a Ruby environment or know Ruby at all. But here's a jsfiddle that reproduces the issue.
http://jsfiddle.net/oq9zg45k/
Yes this could be really usefull
When I try and access
http://artii.herokuapp.com/make?Hi
better using https://artii.herokuapp.com/make?text=Hi