Files
Stevan Freeborn 9a5e00c560 fix: load .env file in integration tests and examples
Add dotenvy to dev-dependencies and call dotenvy::dotenv().ok() in
the integration test common module and all examples so env vars can
be loaded from a .env file.
2026-03-25 19:06:25 -05:00

18 lines
470 B
Rust

use onspring::OnspringClient;
#[tokio::main]
async fn main() -> onspring::Result<()> {
dotenvy::dotenv().ok();
let base_url = std::env::var("API_BASE_URL").expect("API_BASE_URL is required");
let api_key = std::env::var("SANDBOX_API_KEY").expect("SANDBOX_API_KEY is required");
let client = OnspringClient::builder(&api_key)
.base_url(&base_url)
.build();
client.ping().await?;
println!("Connected to the Onspring API successfully.");
Ok(())
}