Env
Binds a configuration field to an environment variable, allowing its value to be overridden at runtime without modifying the YAML file.
When the specified environment variable is set, its value takes precedence over the value defined in the configuration file. Use this for deployment-specific settings such as credentials, hostnames, or feature flags.
Usage:
data class DatabaseConfig(
@Env("DB_HOST")
val host: String = "localhost",
@Env("DB_PORT")
val port: Int = 5432,
@Env("DB_PASSWORD")
@Secret
val password: String = ""
)Content copied to clipboard
Since
1.0