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