21 lines
477 B
Rust
21 lines
477 B
Rust
use envconfig::Envconfig;
|
|
use lazy_static::lazy_static;
|
|
|
|
#[derive(Envconfig, Debug)]
|
|
pub struct Config {
|
|
#[envconfig(from = "BACKEND_BIND_URL")]
|
|
pub bind_url: String,
|
|
|
|
#[envconfig(from = "BACKEND_DB_URL")]
|
|
pub db_url: String,
|
|
|
|
#[envconfig(from = "BACKEND_REDIS_URL")]
|
|
pub redis_url: String,
|
|
|
|
#[envconfig(from = "BACKEND_CACHE_TTL")]
|
|
pub cache_ttl: usize,
|
|
}
|
|
|
|
lazy_static! {
|
|
pub static ref CONFIG: Config = Config::init_from_env().unwrap();
|
|
}
|