Skip to content

Commit

Permalink
fix: do not throw error if .env doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
harshkhandeparkar committed Nov 2, 2024
1 parent fa6a62e commit ca87634
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ mod routing;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Read dotenv if it exists
dotenvy::dotenv()?;
if dotenvy::dotenv().is_ok() {
println!("Loaded an existing .env file.");
}

// Read environment variables
let env_vars = env::EnvVars::parse().process()?;
Expand Down

0 comments on commit ca87634

Please sign in to comment.