Does play configuration application.conf support conditional statement?

It is in application.config to perform any task as per conditional statement as mentioned below:
local = {$IS_LOCAL} //run parameter


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 for FORCED_BASEDIR , but if you set an environment variable FORCED_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:

1 Like

There is conditional support. Use different files for different databases, etc.

Then do something like
to start your program locally. Use a different run statement to start program in the cloud.