blog/backend/src/config.rs
2023-02-12 09:18:56 +01:00

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();
}