parsing after server and app
This commit is contained in:
@@ -26,9 +26,14 @@ impl Settings {
|
||||
let builder = config::Config::builder()
|
||||
.add_source(File::with_name("Settings").required(false))
|
||||
.add_source(
|
||||
Environment::default()
|
||||
.separator("_") // "APP" maps to struct `app`
|
||||
.try_parsing(true),
|
||||
Environment::with_prefix("APP")
|
||||
.separator("_")
|
||||
.prefix_separator("_"),
|
||||
)
|
||||
.add_source(
|
||||
Environment::with_prefix("SERVER")
|
||||
.separator("_")
|
||||
.prefix_separator("_"),
|
||||
);
|
||||
|
||||
builder.build()?.try_deserialize()
|
||||
|
Reference in New Issue
Block a user