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

CORS Error when trying to access the API #1

Closed
adccb opened this issue Feb 3, 2017 · 1 comment
Closed

CORS Error when trying to access the API #1

adccb opened this issue Feb 3, 2017 · 1 comment
Assignees

Comments

@adccb
Copy link

adccb commented Feb 3, 2017

Hey!

I'm trying to build an Ionic application that consumes your API, and I keep running into CORS problems when making a GET request to get some data.

Would you mind enabling cross-origin requests on whatever server hosts your API?

Thanks!

@dmuth dmuth self-assigned this Feb 9, 2017
@dmuth dmuth closed this as completed in 6815140 Feb 9, 2017
@dmuth
Copy link
Owner

dmuth commented Feb 9, 2017

Oh, uh... thanks for closing that automatically, GitHub. 🙀

Anyway, you should now have CORS headers when hitting any URI that starts with /api, as shown below:

$ curl -I www.isseptafucked.com/api
HTTP/1.1 200 OK
Server: Cowboy
Connection: keep-alive
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET
Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept
Content-Type: text/html; charset=utf-8
Content-Length: 6774
Date: Thu, 09 Feb 2017 02:49:47 GMT
Via: 1.1 vegur

Please let me know if you run into any issues.

Thanks,

-- Doug

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

No branches or pull requests

2 participants