It is in application.config to perform any task as per conditional statement as mentioned below:
local = {$IS_LOCAL} //run parameter
if(local){
doThis();
}
It is in application.config to perform any task as per conditional statement as mentioned below:
local = {$IS_LOCAL} //run parameter
if(local){
doThis();
}
There’s no support for generalized conditions, these are better expressed in code.
There is one special case for conditional substitution if a property is defined.
In default uses of the library, exact-match system properties already override the corresponding config properties. However, you can add your own overrides, or allow environment variables to override, using the
${?foo}
substitution syntax.basedir = "/whatever/whatever" basedir = ${?FORCED_BASEDIR}
Here, the override field
basedir = ${?FORCED_BASEDIR}
simply vanishes if there’s no value forFORCED_BASEDIR
, but if you set an environment variableFORCED_BASEDIR
for example, it would be used.
This is commonly used to allow properties to be overridden by environment variables in a production environment.
See the documentation of the Config library for details:
There is conditional support. Use different files for different databases, etc.
application.conf
application.dev.conf
application.prod.conf
Then do something like
run -Dconfig.resource=application.dev.conf
to start your program locally. Use a different run statement to start program in the cloud.