add an example illistrating intigration with the router

This commit is contained in:
Evan Almloff committed 2023-03-31 15:33:44 -05:00
1 parent 976d4ab960
commit bfcb0f6eab
15 files changed
+283 -72

No files matched your search

@@ -8,13 +8,12 @@ edition = "2021"
[dependencies]
dioxus-web = { path = "../../../web", features=["hydrate"], optional = true }
dioxus = { path = "../../../dioxus" }
dioxus-router = { path = "../../../router" }
dioxus-server = { path = "../../" }
axum = { version = "0.6.12", optional = true }
tokio = { version = "1.27.0", features = ["full"], optional = true }
serde = "1.0.159"
tracing-subscriber = "0.3.16"
tracing = "0.1.37"
[features]
ssr = ["axum", "tokio", "dioxus-server/ssr", "dioxus-server/axum"]
web = ["dioxus-web"]
web = ["dioxus-web", "dioxus-router/web"]
@@ -25,7 +25,9 @@ fn main() {
axum::Router::new()
.serve_dioxus_application(
ServeConfig::new(app, ()).head(r#"<title>Hello World!</title>"#),
None,
)
.with_state(SSRState::default())
.into_make_service(),
)
.await