tsk-22: Add function to parse env variable to a vector of strings (#25)
All checks were successful
Release Tagging / release (push) Successful in 33s
Rust Build / Check (push) Successful in 33s
Rust Build / Test Suite (push) Successful in 31s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 32s
Rust Build / build (push) Successful in 30s
All checks were successful
Release Tagging / release (push) Successful in 33s
Rust Build / Check (push) Successful in 33s
Rust Build / Test Suite (push) Successful in 31s
Rust Build / Rustfmt (push) Successful in 31s
Rust Build / Clippy (push) Successful in 32s
Rust Build / build (push) Successful in 30s
Closes #22 Reviewed-on: #25 Co-authored-by: phoenix <kundeng00@pm.me> Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
@@ -90,13 +90,15 @@ pub async fn get_allowed_origins() -> crate::EnvVar {
|
||||
let key = crate::keys::ALLOWED_ORIGINS;
|
||||
let value = std::env::var(key).expect(key);
|
||||
|
||||
crate::init_envvar(key, &value)
|
||||
let mut envvar = crate::init_envvar(key, &value);
|
||||
crate::init_delimiter(&mut envvar, ',');
|
||||
|
||||
envvar
|
||||
}
|
||||
|
||||
/// Get environment not specified in the code
|
||||
pub async fn get_env(environment: &str) -> crate::EnvVar {
|
||||
dotenvy::dotenv().ok();
|
||||
// let key = crate::keys::
|
||||
let my_error = format!("{environment} {}", crate::keys::error::GENERAL_ERROR);
|
||||
let value = std::env::var(environment).expect(&my_error);
|
||||
|
||||
|
Reference in New Issue
Block a user