itsthatguy / avatars-api-middleware

The express middleware for our avatars service
http://avatars.adorable.io
Other
749 stars 96 forks source link

CORS from github? #81

Closed CKGrafico closed 6 years ago

CKGrafico commented 6 years ago

I'm trying to use this api from another github projects but I've CORS error:

Failed to load https://api.adorable.io/avatars/list: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://ckgrafico.github.io' is therefore not allowed access.

bigtiger commented 6 years ago

@CKGrafico Are you still seeing this error?

CKGrafico commented 6 years ago

Yes :( https://ckgrafico.github.io/FooCards-Nuxt/login (click the button)

rylnd commented 6 years ago

@CKGrafico this is expected and intended; you're currently able to generate <img> tags with the proper src attribute that are loaded on the client, but making requests to our API via your javascript is not supported.

If you'd like JS requests to the avatars API to work, you'd be best served by hosting your own instance of the API as an express server running this middleware.

I'm going to close this for now; please reopen this or open another issue if you continue to have trouble.