From 09836fa8a614ee4c0b986c21e370a741ca9ec9d8 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Sat, 21 Mar 2026 19:32:11 +0100 Subject: fix(lib/init): Correctly make the web-app relocatable `reqwest`, which is doing our API requests for us, requires an absolute and not a relative URL. --- index.html | 7 +++++++ src/lib.rs | 20 ++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 3772400..303ca24 100644 --- a/index.html +++ b/index.html @@ -15,6 +15,13 @@ data-weak-refs /> +
+ + impl IntoView { let mut config = Configuration::new(); config.user_agent = Some("rocie-mobile".to_owned()); - "/api/".clone_into(&mut config.base_path); + + let document = document(); + format!( + "{}/api", + document + .query_selector("div#location-storage") + .expect("This part is defined in the index.html") + .expect("This part is really defined in the index.html") + .get_attribute("location") + .expect("This was set in the index.html") + .trim_end_matches('/') + ) + .clone_into(&mut config.base_path); config }; -- cgit 1.4.1