0

I have a project which I have dockerised here: https://github.com/redis-projects/redis-movies/tree/gitpod

I am in the process of trying to get it to work correctly on GitPod, however I am having issues with the frontend react app hitting the backend java service. The react app is running in my local browser so I am confused by which network settings I should use and how to correctly configure.

The docker-compose file when used locally can simply use localhost:8080 to interact with the backend services, but GitPod generates a unique domain over HTTPS. Currently this causes the issues:

Mixed Content: The page at '<URL>' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint '<URL>'. This request has been blocked; the content must be served over HTTPS.

This is self-explanatory, I cant make HTTP requests when the site is loaded via HTTPS. & even if I could, its pointing @ localhost so the service wont resolve.

  1. How can I setup my docker-compose + gitpod configuration to correctly configure the React URL

Currently use env vars:

  • REACT_APP_MOVIE_SERVICE_HOST=localhost
  • REACT_APP_MOVIE_SERVICE_PORT=8080

and this simply builds a url like so (apiConfig.js): http://${process.env.REACT_APP_MOVIE_SERVICE_HOST}:${process.env.REACT_APP_MOVIE_SERVICE_PORT}

  1. Assuming that the backend services are exposed via a public endpoint, I will need to handle any CORs issues since these services are no longer 'local'?
eisenhorn
  • 301
  • 3
  • 10

0 Answers0