From 733827c3e6175fe64f0a74cd4dcb439172f1ec88 Mon Sep 17 00:00:00 2001 From: Brendan Golden Date: Sat, 9 Nov 2024 01:17:43 +0000 Subject: [PATCH] feat: added support for teh new api key --- src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 6abc48a..a3b4edf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,6 +24,8 @@ pub struct Config { // wolves API base for clubs/socs pub wolves_url: String, + // API key for accessing more general resources + pub wolves_api: String, } impl TypeMapKey for Config { type Value = Arc>; @@ -44,6 +46,7 @@ pub fn get_config() -> Config { mail_user: "".to_string(), mail_pass: "".to_string(), wolves_url: "".to_string(), + wolves_api: "".to_string(), }; if let Ok(x) = env::var("DATABASE_HOME") { @@ -74,6 +77,10 @@ pub fn get_config() -> Config { config.wolves_url = x.trim().to_string(); } + if let Ok(x) = env::var("WOLVES_API") { + config.wolves_api = x.trim().to_string(); + } + config }