I am developing a product for my company. This product will not be SAAS and will be deployed at each client's server.
Provided that, I googled how to store api uris in React, but I just found about the using of enviroment variables provided by CRA (AKA .env file).
This does not fulfill my company requirements, that is just "build once, deploy anywhere", with a config key-value file (for instance something like 'APIURI': 'http://foo.bar') read at runtime instead of building the app each time I must deploy it, changing these enviroment variables.
I tried to read an external JSON file, but CRA blocks any import outside the src folder. I also tried this approach: https://stackoverflow.com/a/52184642/12570096 but in the end, it injectes the values too, so whenever I change the config file, it does not updates, so... I wonder if anyone knows any approach to achieve this scenario.
Thanks all!