Add icarus_base_api_url_env (#8)
All checks were successful
Release Tagging / release (push) Successful in 31s
All checks were successful
Release Tagging / release (push) Successful in 31s
Reviewed-on: #8 Co-authored-by: kdeng00 <kundeng00@pm.me> Co-committed-by: kdeng00 <kundeng00@pm.me>
This commit is contained in:
@@ -18,3 +18,8 @@ pub async fn get_root_directory() -> String {
|
||||
dotenvy::dotenv().ok();
|
||||
std::env::var(crate::keys::ROOT_DIRECTORY).expect(crate::keys::error::ROOT_DIRECTORY)
|
||||
}
|
||||
|
||||
pub async fn get_icarus_base_api_url() -> String {
|
||||
dotenvy::dotenv().ok();
|
||||
std::env::var(crate::keys::ICARUS_BASE_API_URL).expect(crate::keys::error::ICARUS_BASE_API_URL)
|
||||
}
|
||||
|
@@ -12,9 +12,13 @@ pub const SECRET_KEY: &str = "SECRET_KEY";
|
||||
// Environment key for root directory for the icarus app
|
||||
pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY";
|
||||
|
||||
// Environment key for icarus api url
|
||||
pub const ICARUS_BASE_API_URL: &str = "ICARUS_BASE_API_URL";
|
||||
|
||||
pub mod error {
|
||||
pub const DB_URL: &str = "DATABASE_URL must be set in .env";
|
||||
pub const SECRET_KEY: &str = "SECRET_KEY must be set in environment file";
|
||||
pub const SECRET_MAIN_KEY: &str = "SECRET_MAIN_KEY must not be set in environment file";
|
||||
pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY must not be set in environment file";
|
||||
pub const ICARUS_BASE_API_URL: &str = "ICARUS_BASE_API_URL must not be set in enviornment file";
|
||||
}
|
||||
|
Reference in New Issue
Block a user