I want to set value for one of config variable in application.conf using environment variable. But if this env variable is not present I want to default config to a certain value instead of erring out.
Is this possible? Here is setting for reference.
test.myframework {
host = ${TEST_HOST_NAME}
}
Here if TEST_HOST_NAME if not present can I default host to localhost?
In Microsoft Windows, each environment variable's default value is stored in the Windows Registry or set in the AUTOEXEC. BAT file.
Also, env variables are always strings.
This is described in the play documentation Production Configuration:
my.key = defaultvalue
my.key = ${?MY_KEY_ENV}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With