use envkit::EnvLoader;

fn main() -> Result<(), envkit::error::EnvError> {
    let loader = EnvLoader;
    let app = loader.with_prefix("APP_");

    let host: String = app.get("HOST")?;
    let port: u16 = app.get_or("PORT", 8080);
    let enabled: bool = app.get_or("ENABLED", false);

    println!("host={host}");
    println!("port={port}");
    println!("enabled={enabled}");

    Ok(())
}
