feat: added examples

This commit is contained in:
darwincereska
2026-06-08 01:17:44 -04:00
parent 5650a6ce48
commit ff7ce95000
3 changed files with 110 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
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(())
}