Hello, I built a covid-tracker web app using javascript, HTML, and CSS. The API is from covid19api.com. The app works when I serve the app on my localhost server but when I deploy the same site via Netlify the API call never seems to occur.
Could it be something wrong with the API? Could it be Netlify blocking it? Please Help thanks.
Hi, @Ethan242. There are several possible reasons so, instead of guessing, being able to look at your site is important. As, @hrishikesh said above, would you please send is a link to the site so we can see the error in our own browsers?
Also, did you check for errors in the console in the browser devtools?
Try using https anyways. If they’ve configured their API to work on https and just mentioned http in the documention, it’ll work. However if it only works on http, then it won’t and you should look for some secure alternative.
I see the same behaviour when running your code locally too—the same advice every time. If I use cURL (curl https://api.adviceslip.com/advice) or visit https://api.adviceslip.com/advice in the browser and refresh the page several times, I do see different advice each time.