We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The text was updated successfully, but these errors were encountered:
Please load .env files by dotenv or dotenvy firstly, then parse the environments with envy.
Sorry, something went wrong.
@Silentdoer that's how I implemented it in my project following the "Zero to production in Rust" book (it is recommended to use YAMLs there but I decided to do it my way): https://github.com/serge-klochkov/zero2prod/blob/main/src/config.rs#L24-L45
@arniu you can do it manually, just load it first
use serde::Deserialize; #[derive(Deserialize, Debug)] pub struct Config { pub pg_db_url: String, pub mysql_db_url: String, } pub fn config() -> Result<Config, envy::Error> { dotenvy::dotenv().ok(); // ! envy::from_env::<Config>() }
No branches or pull requests
💡 Feature description
💻 Basic example
The text was updated successfully, but these errors were encountered: