feat: load config from env vars (#576)
Signed-off-by: Nico <nico.macioszek@gmail.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
use std::{collections::HashMap, path::Path};
|
use std::{collections::HashMap, path::Path};
|
||||||
|
|
||||||
use cached::proc_macro::cached;
|
use cached::proc_macro::cached;
|
||||||
use config::{Config, File, FileFormat};
|
use config::{Config, Environment, File, FileFormat};
|
||||||
use futures_locks::RwLock;
|
use futures_locks::RwLock;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
@@ -109,6 +109,8 @@ static CONFIG_BUILDER: Lazy<RwLock<Config>> = Lazy::new(|| {
|
|||||||
cwd = path.parent();
|
cwd = path.parent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
builder = builder.add_source(Environment::with_prefix("REVOLT").separator("__"));
|
||||||
|
|
||||||
builder.build().unwrap()
|
builder.build().unwrap()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user