Added functions to retrieve environment values
This commit is contained in:
@@ -3,3 +3,13 @@ pub async fn get_db_url() -> String {
|
|||||||
dotenvy::dotenv().ok();
|
dotenvy::dotenv().ok();
|
||||||
std::env::var(crate::keys::DBURL).expect(crate::keys::error::ERROR)
|
std::env::var(crate::keys::DBURL).expect(crate::keys::error::ERROR)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn get_secret_main_key() -> String {
|
||||||
|
dotenvy::dotenv().ok();
|
||||||
|
std::env::var(crate::keys::SECRET_MAIN_KEY).expect(crate::keys::error::SECRET_MAIN_KEY)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn get_root_directory() -> String {
|
||||||
|
dotenvy::dotenv().ok();
|
||||||
|
std::env::var(crate::keys::ROOT_DIRECTORY).expect(crate::keys::error::ROOT_DIRECTORY)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user