Home > Mobile >  API fetching didn't work after I deployed
API fetching didn't work after I deployed

Time:12-15

I deployed my React web work as a test at Vercel but the API didn't work and my web now is Empty.. my project and api works perfectly in my localhost ! some one knows why ?

my empty web :- https://web-3-0-prokect-1.vercel.app/

api code in the useEffect hook:- https://github.com/Adelndf/web.3.0-prokect-1/blob/master/src/App.js

by the way im new in coding so some of my coding words or terms might be little bit weird :) hopefully someone understand my issue here

CodePudding user response:

Your API request is not successful because of CORS error. This usually won't be an issue when you try in localhost. To learn more about CORS, click here.

CodePudding user response:

I fixed it with the easy way cuz at the end its just a testing project.. the solution if any one needed it is :-

i added ( https://cors-anywhere.herokuapp.com/ ) before my api ulr and it works..

u can see it in github link at the top

  • Related