2023-02-07 06:02:51 +00:00
|
|
|
use envconfig::Envconfig;
|
|
|
|
use lazy_static::lazy_static;
|
|
|
|
|
|
|
|
#[derive(Envconfig, Debug)]
|
|
|
|
pub struct Config {
|
2023-02-11 11:48:39 +00:00
|
|
|
#[envconfig(from = "BACKEND_BIND_URL")]
|
|
|
|
pub bind_url: String,
|
|
|
|
|
2023-02-07 06:02:51 +00:00
|
|
|
#[envconfig(from = "BACKEND_DB_URL")]
|
|
|
|
pub db_url: String,
|
2023-02-11 11:48:39 +00:00
|
|
|
|
|
|
|
#[envconfig(from = "BACKEND_REDIS_URL")]
|
|
|
|
pub redis_url: String,
|
|
|
|
|
|
|
|
#[envconfig(from = "BACKEND_CACHE_POST_CONTENT_TTL")]
|
|
|
|
pub cache_post_content_ttl: usize,
|
2023-02-07 06:02:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
lazy_static! {
|
|
|
|
pub static ref CONFIG: Config = Config::init_from_env().unwrap();
|
|
|
|
}
|