brigadecore / brigade-dashboard

Apache License 2.0
4 stars 5 forks source link

allow API address to be overridden with env var #43

Closed krancour closed 2 years ago

krancour commented 2 years ago

This is a long overdue fix that makes the address of the API server configurable without touching Config.js.

The app only uses REACT_APP_BRIGADE_API_ADDRESS when the development server is running.

REACT_APP_BRIGADE_API_ADDRESS is not defined at build time (e.g. in the Dockerfile), so the address of the API server falls back to window.location.origin + "/api" (i.e. a reverse proxy for the API server, whose address is install-time configurable).

See https://create-react-app.dev/docs/adding-custom-environment-variables/ for better understanding of how this works.