Skip to content

Commit ca87634

Browse files
fix: do not throw error if .env doesn't exist
1 parent fa6a62e commit ca87634

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

backend/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ mod routing;
1111
#[tokio::main]
1212
async fn main() -> Result<(), Box<dyn std::error::Error>> {
1313
// Read dotenv if it exists
14-
dotenvy::dotenv()?;
14+
if dotenvy::dotenv().is_ok() {
15+
println!("Loaded an existing .env file.");
16+
}
1517

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

0 commit comments

Comments
 (0)