Add icarus_base_api_url_env #8
@@ -6,3 +6,4 @@ POSTGRES_MAIN_PASSWORD=password
|
|||||||
POSTGRES_MAIN_DB=my_db
|
POSTGRES_MAIN_DB=my_db
|
||||||
POSTGRES_MAIN_HOST=localhost
|
POSTGRES_MAIN_HOST=localhost
|
||||||
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
|
DATABASE_URL=postgres://${POSTGRES_MAIN_USER}:${POSTGRES_MAIN_PASSWORD}@${POSTGRES_MAIN_HOST}:5432/${POSTGRES_MAIN_DB}
|
||||||
|
ICARUS_BASE_API_URL=https://icarus.com
|
||||||
|
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -277,7 +277,7 @@ checksum = "f154ce46856750ed433c8649605bf7ed2de3bc35fd9d2a9f30cddd873c80cb08"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "icarus_envy"
|
name = "icarus_envy"
|
||||||
version = "0.1.0"
|
version = "0.2.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"async-std",
|
"async-std",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
|
@@ -18,3 +18,8 @@ pub async fn get_root_directory() -> String {
|
|||||||
dotenvy::dotenv().ok();
|
dotenvy::dotenv().ok();
|
||||||
std::env::var(crate::keys::ROOT_DIRECTORY).expect(crate::keys::error::ROOT_DIRECTORY)
|
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,12 @@ pub const SECRET_KEY: &str = "SECRET_KEY";
|
|||||||
// Environment key for root directory for the icarus app
|
// Environment key for root directory for the icarus app
|
||||||
pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY";
|
pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY";
|
||||||
|
|
||||||
|
pub const ICARUS_BASE_API_URL: &str = "ICARUS_BASE_API_URL";
|
||||||
|
|
||||||
pub mod error {
|
pub mod error {
|
||||||
pub const DB_URL: &str = "DATABASE_URL must be set in .env";
|
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_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 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 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