. Is it possible for the appropriate file to be set automatically based on my environment? How do I detect what environment I am in to be able to set the config file?
g
gildor
05/20/2019, 1:28 AM
You can use environment variable to set required config
One more approach is to have specify special server runner for dev environment and specify different config
v
voben
05/20/2019, 2:49 AM
Thanks for your response Andrey, but using environment variables doesn’t allow me to change my config file. It only allows me to read the variables in the already loaded config file.
Also what do you mean by specify a special server runner. Could you elaborate on how to do this?
g
gildor
05/20/2019, 5:16 AM
You can change config file, because hocon files support environment variables, see doc which I sent above, you can just read env var if it available
gildor
05/20/2019, 5:19 AM
About runner, I mean that depending how you start your server, you can just have 2 different tasks/commands to run it with different arguments
gildor
05/20/2019, 5:20 AM
Also, after all, you free to load any config file manually, it's not necessary to use standard application.conf file, and use any loading logic as you want