Use separate server main in main.rs
Some checks failed
Push Workflows / rustfmt (push) Successful in 5s
Push Workflows / tailwind-build (push) Successful in 5s
Push Workflows / test (push) Successful in 18s
Push Workflows / docs (push) Successful in 19s
Push Workflows / clippy (push) Successful in 15s
Push Workflows / build (push) Successful in 42s
Push Workflows / nix-build (push) Has been cancelled

This commit is contained in:
2026-06-21 16:39:41 -04:00
parent 3c58192957
commit a6b635fef0
2 changed files with 15 additions and 4 deletions

View File

@@ -38,12 +38,19 @@ fn Home() -> Element {
} }
} }
fn main() { fn tracing_setup() {
#[cfg(debug_assertions)] #[cfg(debug_assertions)]
dioxus::logger::init(tracing::Level::DEBUG).expect("Failed to initialize tracing logger"); dioxus::logger::init(tracing::Level::DEBUG).expect("Failed to initialize tracing logger");
}
#[cfg(feature = "server")] #[cfg(not(feature = "server"))]
server::main(); fn main() {
tracing_setup();
dioxus::launch(App); dioxus::launch(App);
} }
#[cfg(feature = "server")]
fn main() {
tracing_setup();
server::main()
}

View File

@@ -1,5 +1,9 @@
use crate::App;
pub fn main() { pub fn main() {
if let Err(e) = dotenvy::dotenv() { if let Err(e) = dotenvy::dotenv() {
tracing::warn!("Error reading .env: {e}"); tracing::warn!("Error reading .env: {e}");
} }
dioxus::launch(App);
} }