2026-09-03 10:03:15 +00:00
|
|
|
mod api;
|
2026-08-20 15:04:14 +00:00
|
|
|
mod app;
|
|
|
|
|
|
2026-09-16 12:59:03 +00:00
|
|
|
#[cfg(feature = "desktop")]
|
|
|
|
|
mod desktop;
|
|
|
|
|
|
2026-08-20 15:04:14 +00:00
|
|
|
#[cfg(feature = "server")]
|
|
|
|
|
mod server;
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
|
#[cfg(feature = "server")]
|
|
|
|
|
server::init_tracing();
|
|
|
|
|
|
2026-09-15 10:36:22 +00:00
|
|
|
// `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")]
|
2026-09-16 12:59:03 +00:00
|
|
|
dioxus::LaunchBuilder::desktop()
|
|
|
|
|
.with_cfg(desktop::config())
|
|
|
|
|
.launch(app::App);
|
2026-09-15 10:36:22 +00:00
|
|
|
|
|
|
|
|
#[cfg(not(feature = "desktop"))]
|
2026-08-20 15:04:14 +00:00
|
|
|
dioxus::launch(app::App);
|
|
|
|
|
}
|