Access environment variable for React app

Ok, seems to be solved now. I needed to prepend the environment variable in my React app with “https://” before using it in the app.

Everything seems to be working now. To summarized just needed to do the following:

  1. Add “ARG REACT_APP_BACKEND_URL” to Dockerfile
  2. Prepend environment variable value with “https://” in the React code.
2 Likes