Implements Configuration via Env Variables
This commit is contained in:
17
src/config/config_auth.rs
Normal file
17
src/config/config_auth.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use std::env;
|
||||
use cached::proc_macro::cached;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ConfigAuth {
|
||||
pub auth_url: String,
|
||||
}
|
||||
|
||||
#[cached]
|
||||
pub fn get_config_auth() -> ConfigAuth {
|
||||
let url = env::var("AUTH_URL")
|
||||
.expect("AUTH_URL must be set");
|
||||
|
||||
ConfigAuth {
|
||||
auth_url: url,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user