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
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:
15
src/main.rs
15
src/main.rs
@@ -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()
|
||||||
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user