diff --git a/gui/Dioxus.toml b/gui/Dioxus.toml index b4e1acb..a9cc171 100644 --- a/gui/Dioxus.toml +++ b/gui/Dioxus.toml @@ -11,7 +11,6 @@ asset_dir = "public" [web.app] # HTML title tag content title = "Mumble Web 2" -base_path = "gui" [web.watcher] # when watcher trigger, regenerate the `index.html` diff --git a/proxy/src/main.rs b/proxy/src/main.rs index 513dc16..fd3feaa 100644 --- a/proxy/src/main.rs +++ b/proxy/src/main.rs @@ -65,11 +65,6 @@ async fn serve_gui_index_html(req: &Request, res: &mut Response) { res.render(Text::Html(modified_html)); } -#[handler] -async fn redirect_to_gui(res: &mut Response) { - res.render(Redirect::permanent("/gui")); -} - async fn init_config() -> Result<()> { let mut config: Config = toml::from_str( &fs::read_to_string("./config.toml") @@ -100,18 +95,14 @@ async fn main() -> Result<()> { init_logging(); init_config().await?; let config = CONFIG.get().unwrap(); + info!("config\n{}", toml::to_string_pretty(&config.gui)?); + info!("gui config\n{}", serde_json::to_string_pretty(&config.gui)?); // Server routing let router = Router::new() - .get(redirect_to_gui) + .get(serve_gui_index_html) .push(Router::with_path("/proxy").goal(connect_proxy)) - .push(Router::with_path("/gui").get(serve_gui_index_html)) - .push(Router::with_path("/gui/<*+rest>").get(StaticDir::new(config.gui_path.clone()))) - // right now dioxus assets don't properly handle base_url, so we are stuck with this - .push( - Router::with_path("/assets/<*+rest>") - .get(StaticDir::new(config.gui_path.join("assets"))), - ) + .push(Router::with_path("/<*+rest>").get(StaticDir::new(config.gui_path.clone()))) .hoop(Logger::new()); // Read server certs