Fix salvo fullstack builds

This commit is contained in:
Evan Almloff committed 2023-07-10 18:48:55 -05:00
1 parent 73a45fb113
commit 0e83d48c04
4 files changed
+102 -114

No files matched your search

+3 -2
View File
@@ -161,11 +161,12 @@ pub async fn launch_server<P: Clone + serde::Serialize + Send + Sync + 'static>(
#[cfg(all(feature = "salvo", not(feature = "axum"), not(feature = "warp")))]
{
use crate::adapters::salvo_adapter::DioxusRouterExt;
use salvo::conn::Listener;
let router = salvo::Router::new().serve_dioxus_application("", cfg).hoop(
salvo::compression::Compression::new()
.with_algos(&[salvo::prelude::CompressionAlgo::Gzip]),
.enable_gzip(salvo::prelude::CompressionLevel::Default),
);
salvo::Server::new(salvo::listener::TcpListener::bind(addr))
salvo::Server::new(salvo::conn::tcp::TcpListener::new(addr).bind().await)
.serve(router)
.await;
}