Files
meet/src
antoine lebaud a480c50221 🔧(frontend) refactor API URl to work for remote environments
Discussed IRL with @manuhabitela. In developpement, we build locally the
Docker image. Thus, we can pass values to the frontend before the npm build
command was called.

Environment variables are great for configuration, and work perfectly in dev
mode, building Docker image on the fly.

However, in other environment (e.g. staging, pre-prod, prod) we'll pull a common
Docker image published in a remote registry. All cited environments should use
the same Docker image to make tests/deployment reproducible between envs.

As the Docker image is not rebuilt on the fly, we cannot easily configure
customized environment variables for each environment.

The API base URL would have a different value for each environment, and would
require a different environment variable.

Inspired by Impress works, if no environment variable is passed for the API URL,
the window origin will be used, and then the API path will be appended.

Frontend and backend are always deployed on the same URL, usually frontend
is at the '/' route, and backend at the '/api/vXX/' route.

If any configuration are required for each remote environment, they would be
retrieved from the API at runtime.

Voila! Don't hesitate to challenge this commit.
2024-07-10 23:33:05 +02:00
..
2024-07-01 20:34:08 +02:00
2024-07-01 20:34:08 +02:00