solusi untuk masalah gagal fecth API

Access to fetch at '' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
avatar ishafiuddinismail


1 Kontribusi 1 Poin


Masalah CORS ini, bisa jadi sengaja dari developer untuk memproteksi APInya

cek di dokumentasi edamam nya

Do you support direct requests from the browser (AJAX, JSONP, CORS)?

- For the Recipe Analysis API and Nutrition Data API the answer is no and we currently don't plan to. There are two reasons behind this:

First, to access one of these APIs the request needs to include valid credentials (for example app_id and app_key). This would make it very easy for somebody to steal them.

The second reason is, that direct access means direct charges from Edamam caused by the use of your site. Instead we expect that our customers develop server-side solutions that save the responses.

For the Diet Recommendations API and Recipe Search API we do support JSONP through the callback parameter. However, we are discouraging this, because of the same security issue.
avatar hilmanski


2338 Kontribusi 1962 Poin

Login untuk gabung berdiskusi
premium logo tube

Hey, sedang ada diskon premium untuk akses semua kelas. Lihat di sini