mod api; mod app; #[cfg(feature = "desktop")] mod desktop; #[cfg(feature = "server")] mod server; fn main() { #[cfg(feature = "server")] server::init_tracing(); // `dioxus::launch`'s automatic platform detection prioritizes "server" // over "desktop" when both features are enabled (as they are for the // desktop build, which embeds the server feature for in-process // `#[server]` calls) — it would stand up an axum server instead of a // window. Pick the desktop renderer explicitly in that case. #[cfg(feature = "desktop")] dioxus::LaunchBuilder::desktop() .with_cfg(desktop::config()) .launch(app::App); #[cfg(not(feature = "desktop"))] dioxus::launch(app::App); }