A dotenv solution for Rust.
To install this package, run the following command:
cargo add dotenv_plus
Write the environment variables in the env files and access them later using the var
function:
KEY=value
use dotenv_plus::{
DotEnv,
var,
};
DotEnv::new().run();
assert_eq!(var("RUST_ENV"), "production");
assert_eq!(var("KEY"), "value");
# By default, `RUST_ENV` is set to `development`
RUST_ENV=production cargo run
This project is licensed under the terms of the MIT license.