Environment (#3)
All checks were successful
Release Tagging / release (push) Successful in 26s

Reviewed-on: #3
Co-authored-by: kdeng00 <kundeng00@pm.me>
Co-committed-by: kdeng00 <kundeng00@pm.me>
This commit is contained in:
2025-05-29 23:15:44 +00:00
committed by phoenix
parent b89633e394
commit f0726b83c9
5 changed files with 30 additions and 0 deletions

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";
}

View File

@@ -1,3 +1,6 @@
pub mod environment;
pub mod keys;
pub fn add(left: u64, right: u64) -> u64 {
left + right
}