Hello folks... I have a more complicated application configuration question.
Imagine a carmaker application, that runs on multiple environments for each carmaker.
• tesla - development, staging, production
• honda - development, testing, staging, production
• ford - development, qa, staging, production
I think you got the idea... every "profile" can have multiple envs, each one needs its own configuration values.
questions:
is it possible to setup a Ktor application to fit these needs?
is using
-config
via command line the best approach?
Copy code
java -jar sample-app.jar -config=anotherfile.conf
a
Aleksei Tirman [JB]
11/08/2022, 8:41 AM
is it possible to setup a Ktor application to fit these needs?
Yes.
is using
-config
via command line the best approach?
That’s difficult to answer. You can try solving your problem with configuration, environment variables or both to decide what’s better.
l
Luiz Aguiar
11/08/2022, 9:07 AM
@Aleksei Tirman [JB] thanks for replying.
from the framework perspective (features set), what options we might have to achieve this setup?
I asked about the
-config
because I didn't find another option to have multiple "profiles" that can be loaded on specific environments, but I'm don't know if there is any other option.
a
Aleksei Tirman [JB]
11/08/2022, 11:25 AM
The simplest solution I can think of is to use some naming convention for configs, e.g.
<profile>_<env>.conf
, if you need to know what are the current profile and environment.