Reputation: 89
I am getting an error like:
Mixed Content: The page at 'https://reactapp.herokuapp.com/' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.//'. This request has been blocked; the content must be served over HTTPS.
Failed to load resource: the server responded with a status of 404 (Not Found)
Upvotes: 0
Views: 803
Reputation: 464
Chrome browser blocks mixed content by default. As your React app is getting served using https and your api is getting served using http, it is blocking the api service.
One way to solve this problem is to
create-react-app
. This way your API backend would be also served with https solving mixed content issue. For more details regarding deployment to heroku refer to https://medium.freecodecamp.org/how-to-make-create-react-app-work-with-a-node-backend-api-7c5c48acb1b0.
Upvotes: 0