Environment #3

Merged
phoenix merged 4 commits from environment into devel 2025-05-29 23:15:44 +00:00
2 changed files with 10 additions and 0 deletions
Showing only changes of commit e3b80c7230 - Show all commits

5
src/environment.rs Normal file
View File

@@ -0,0 +1,5 @@
pub async fn get_db_url() -> String {
dotenvy::dotenv().ok();
std::env::var(crate::keys::DBURL).expect(crate::keys::error::ERROR)
}

5
src/keys.rs Normal file
View File

@@ -0,0 +1,5 @@
pub const DBURL: &str = "DATABASE_URL";
pub mod error {
pub const ERROR: &str = "DATABASE_URL must be set in .env";
}