Compare commits
1 Commits
v0.4.1-mai
...
v0.3.3-20-
Author | SHA1 | Date | |
---|---|---|---|
a8ec7cae78
|
@@ -58,3 +58,10 @@ pub async fn get_allowed_origins() -> String {
|
|||||||
dotenvy::dotenv().ok();
|
dotenvy::dotenv().ok();
|
||||||
std::env::var(crate::keys::ALLOWED_ORIGINS).expect(crate::keys::error::ALLOWED_ORIGINS)
|
std::env::var(crate::keys::ALLOWED_ORIGINS).expect(crate::keys::error::ALLOWED_ORIGINS)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get environment not specified in the code
|
||||||
|
pub async fn get_env(environment: &str) -> String {
|
||||||
|
dotenvy::dotenv().ok();
|
||||||
|
let my_error = format!("{environment} {}", crate::keys::error::GENERAL_ERROR);
|
||||||
|
std::env::var(environment).expect(&my_error)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user