Determine the environment from config file. #4755
Replies: 4 comments
-
How about adding a field to your configuration class which specifies the environment (could be a string or an enum) and read it in your application? |
Beta Was this translation helpful? Give feedback.
-
That's one way of doing it. But then will have to maintain this config for all environment. |
Beta Was this translation helpful? Give feedback.
-
@anandagarwaal-zz That's exactly what you described, isn't it?
|
Beta Was this translation helpful? Give feedback.
-
@joschi I'll try your approach by creating field which determine which type of config it is. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have 2 configuration (staging and production) yml files in my Dropwizard project. I need to determine which environment (staging or production) I am running the application. I was thinking if I could get the filename somehow, I should be able to set the environment in global variable.
Any idea how could I achieve this.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions