Api's on my app are working locally, but as soon as I deploy the app to Vercel, they don't work anymore. JavaScript

Viewed 10

you can find full app code on https://github.com/TheaAleksovDev/Weather-App

Here are my fetches(just the first part of them)

1.fetch(`http://api.openweathermap.org/geo/1.0/direct?q=${city}&limit=5&appid=${weather.key}`) 2.fetch(`https://api.openweathermap.org/data/2.5/forecast?lat=${currentCity.lat}&lon=${currentCity.lon}&appid=${weather.key}&units=metric`)

And these are the errors that I get in the console when I use app AFTER DEPLOYMENT

Mixed Content: The page at 'https://app-weather-506w3kfzm-theaaleksovdev.vercel.app/' was loaded over HTTPS, but requested an insecure resource 'http://api.openweathermap.org/geo/1.0/direct?q=nis&limit=5&appid=8e29deb48c288702515835df3a389ef3'. This request has been blocked; the content must be served over HTTPS.

Uncaught (in promise) TypeError: Failed to fetch at search (index.js:47:5)at HTMLInputElement.<anonymous> (index.js:37:5)

0 Answers
Related