Does the DHIS2 Application Platform allow for importing additional environment variables? If I add a AAAA=1
to my .env
file I cannot see it on a console.log(process.env)
.
Thanks to @tzemp I found out that DHIS2_APP_BLAH
becomes REACT_APP_DHIS2_APP_BLAH
. It is a good start.
Hi Greg - yes, environment variables must be prefixed with DHIS2_
and they will be prefixed with REACT_APP_DHIS2
when the application is built. However, this is not an officially-supported feature and will likely change in the future. I wouldn’t recommend using custom environment variables unless you really need to - what is your use case here?
The use case is while in development needing to configure dev/stage/test builds that have slightly different settings. In my particular case, pointing at different external apis to pull additional information.