I want to specify different types of configs depending on the environment that I will deploy the app. Like in Spring-boot in the yml file we can set the profile, I want to know if there is a way to do it in Micronaut.
Asked
Active
Viewed 8,193 times
1 Answers
14
You can set active environment(s) either by system property micronaut.environments
(java -Dmicronaut.environments=foo,bar -jar myapp.jar
) or by environment variable MICRONAUT_ENVIRONMENTS
.
See Documentation: https://docs.micronaut.io/snapshot/guide/index.html#environments
![](../../users/profiles/3388069.webp)
Sascha Frinken
- 2,274
- 1
- 19
- 23
-
7We also support config files like `application-gcp.yml`, which would only be loaded if running on GCP (for example). – Jeff Scott Brown Sep 16 '18 at 23:59