digitalepidemiologylab / foodrepo_api

FoodRepo API
Other
60 stars 6 forks source link

OpenFood-api v2 throws CORS error #15

Closed PhilippRoessner closed 6 years ago

PhilippRoessner commented 6 years ago

today I encounter problems with accessing the API.

Failed to load https://www.openfood.ch/api/v2/products/_search: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.

PhilippRoessner commented 6 years ago

Seems to work after changing all URLs from openfood.ch to foodrepo.org

bkDJ commented 6 years ago

Also please consider using v3. The search endpoint is more flexible, and v2 may be sunset soon.

bkDJ commented 6 years ago

CORS headers added back to old endpoints.