Compare commits
4 Commits
v0.1.0-dev
...
v0.2.0
Author | SHA1 | Date | |
---|---|---|---|
3ee8c1e573 | |||
dbe4dc67cb | |||
6c37c19a57 | |||
9aa16a3f2e |
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "icarus_envy"
|
||||
version = "0.1.0"
|
||||
version = "0.2.0"
|
||||
edition = "2024"
|
||||
rust-version = "1.86"
|
||||
|
||||
|
5
README.md
Normal file
5
README.md
Normal file
@@ -0,0 +1,5 @@
|
||||
This is a library used to retrieve environment variables associated with various
|
||||
icarus projects. Rather than having the various icarus projects such as icarus,
|
||||
icarus_auth, songparser, and others, have environment code, it would be more
|
||||
efficient to consolidate it. Especially, if there are commonly used environment
|
||||
variables used throughout the apps.
|
@@ -1,7 +1,7 @@
|
||||
|
||||
pub async fn get_db_url() -> String {
|
||||
dotenvy::dotenv().ok();
|
||||
std::env::var(crate::keys::DBURL).expect(crate::keys::error::ERROR)
|
||||
std::env::var(crate::keys::DB_URL).expect(crate::keys::error::DB_URL)
|
||||
}
|
||||
|
||||
pub async fn get_secret_main_key() -> String {
|
||||
|
@@ -1,6 +1,5 @@
|
||||
// TODO: Change this to snake case
|
||||
// Environment key for Database management
|
||||
pub const DBURL: &str = "DATABASE_URL";
|
||||
pub const DB_URL: &str = "DATABASE_URL";
|
||||
|
||||
// Environment key for secret main key
|
||||
// Used for the icarus app
|
||||
@@ -14,7 +13,7 @@ pub const SECRET_KEY: &str = "SECRET_KEY";
|
||||
pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY";
|
||||
|
||||
pub mod error {
|
||||
pub const ERROR: &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_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";
|
||||
|
Reference in New Issue
Block a user