fix cargo check all features except the router
This commit is contained in:
1 parent
2952578a2e
commit
14b4af4bbc
7 files changed
+105
-93
No files matched your search
@@ -7,7 +7,7 @@ publish = false
|
||||
[lib]
|
||||
|
||||
[dependencies]
|
||||
dioxus = { workspace = true, features = ["launch"] }
|
||||
dioxus = { workspace = true, features = ["launch", "fullstack"] }
|
||||
axum = { workspace = true, optional = true }
|
||||
tokio = { workspace = true, features = ["full"], optional = true }
|
||||
serde = "1.0.159"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
use axum_desktop::*;
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_fullstack::server_fn::axum::register_explicit;
|
||||
use server_fn::axum::register_explicit;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
|
||||
@@ -14,16 +14,25 @@ use serde::{Deserialize, Serialize};
|
||||
#[cfg(feature = "server")]
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
pre_cache_static_routes(
|
||||
&ServeConfig::new_with_router(
|
||||
dioxus_fullstack::router::FullstackRouterConfig::<Route>::default(),
|
||||
)
|
||||
.assets_path("docs")
|
||||
.incremental(IncrementalRendererConfig::default().static_dir("docs"))
|
||||
.build(),
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
let wrapper = DefaultRenderer {
|
||||
before_body: r#"<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width,
|
||||
initial-scale=1.0">
|
||||
<title>Dioxus Application</title>
|
||||
</head>
|
||||
<body>"#
|
||||
.to_string(),
|
||||
after_body: r#"</body>
|
||||
</html>"#
|
||||
.to_string(),
|
||||
};
|
||||
let mut renderer = IncrementalRenderer::builder().build();
|
||||
pre_cache_static_routes::<Route, _>(&mut renderer, &wrapper)
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
// Hydrate the page
|
||||
|
||||
Reference in new issue
Block a user