Open anfern777 opened 17 hours ago
The solution I thought about consists on creating an angular configuration for each environment and build it using the env config as an argument. E.g. ng build --configuration staging
. This would inject the env variable corresponding to the provided configuration into the angular app. Then, after build, we would copy the static assets into folder src/resources/static
with an heroku cd script.
For context: Spring Boot is serving static assets (the built SPA app) from src/resources/static. So currently the app is being built locally and its static files manually copied to this directory before deployment. The idea would be to dynamically build it based on the environment with the configuration arg.
Other suggestions welcome.
We already do something similar in this project in case it serves as inspiration: https://github.com/s1seven/dmp-explorer-poc/blob/main/set-env.js
Description
Currently the UI is explicitly pointing to the development server api. This behaviour should be changed so that it dynamically fetches the current environment and calls the corresponding api URL.
Expected Behaviour
local - api should call
http://localhost:8081
development - api should callhttps://schemas-service.development.s1seven.com
staging - api should callhttps://schemas-service.staging.s1seven.com
production - api should callhttps://schemas-service.s1seven.com