feat: update environment configuration for local development and enhance deployment scripts

This commit is contained in:
2026-04-16 10:11:19 -04:00
parent 6aa0b235c3
commit 387d473a7c
9 changed files with 177 additions and 202 deletions
+10 -1
View File
@@ -35,7 +35,16 @@ use utoipa::OpenApi;
#[tokio::main]
async fn main() {
dotenvy::from_filename(".env.dev").or_else(|_| dotenv()).ok();
let env_mode = std::env::var("ENVIRONMENT")
.unwrap_or_else(|_| "prod".to_string())
.to_lowercase();
if env_mode == "dev" {
dotenvy::from_filename(".env.dev").or_else(|_| dotenv()).ok();
} else {
dotenv().ok();
}
tracing_subscriber::fmt::init();
let db_url = env::var("DATABASE_URL").expect("DATABASE_URL debe estar configurada");