13 lines
267 B
Rust
13 lines
267 B
Rust
pub struct Config {
|
|
pub bind_addr: String,
|
|
}
|
|
|
|
impl Config {
|
|
pub fn from_env() -> anyhow::Result<Self> {
|
|
let bind_addr =
|
|
std::env::var("API_BIND_ADDR").unwrap_or_else(|_| "0.0.0.0:8080".to_string());
|
|
|
|
Ok(Self { bind_addr })
|
|
}
|
|
}
|