Having this client-side configuration (react based)
export const config = {
API_URL: process.env.NODE_ENV === 'production' ? 'https://myserverapp.herokuapp.com/' : 'http://mywebapp/'
}
When deploying it to the server (some shared hosting server) and sending the requests to my backend server (lumen based on heroku server) I get this error -
Mixed Content: The page at 'https://mywebapp.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://myserverapp.herokuapp.com/items'. This request has been blocked; the content must be served over HTTPS.
- at the beginning the app was build by Angular and all works great! Now when switching to react this error happens.
What is happening? How can I fix it?
http://myserverapp.herokuapp.com/items
it should be to https – Nir Ben-Yair