Skip to content

Commit 311ec1b

Browse files
committed
Env var for api key
1 parent 1362814 commit 311ec1b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/api.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use reqwest::{Client, Response, Url};
1212
use crate::db::UsersRow;
1313

1414
/// No changes can be made with this API key so it can be public
15-
const BUNGIE_KEY: &'static str = "529cac5f9e3a482b86b931f1f75f2331";
15+
const BUNGIE_KEY: &'static str = std::env!("BUNGIE_API_KEY");
1616

1717
lazy_static! {
1818
pub static ref NETWORK_CLIENT: Client = reqwest::Client::builder()
@@ -266,9 +266,16 @@ pub async fn get_collections(membership_id: u64, platform: Option<i8>, i: u32) -
266266
return default;
267267
}
268268

269+
// Print json
270+
271+
println!("Json: {}", ra.unwrap().text().await.unwrap());
272+
273+
return default;
274+
269275
let ja = ra.unwrap().json::<GetProfile>().await;
270276

271277
if ja.is_err() {
278+
println!("Error: {:?}", ja.err());
272279
return default;
273280
}
274281

0 commit comments

Comments
 (0)