Merge pull request #1263 from Demonthos/builder-launch-fullstack

Switch to launch builder instead of macro for fullstack
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2023-07-31 11:44:36 -07:00
commit e1dcc335c0
13 files changed
+259 -193

No files matched your search

@@ -369,7 +369,8 @@ fn apply_request_parts_to_response<B>(
}
}
async fn render_handler<P: Clone + serde::Serialize + Send + Sync + 'static>(
/// SSR renderer handler for Axum
pub async fn render_handler<P: Clone + serde::Serialize + Send + Sync + 'static>(
State((cfg, ssr_state)): State<(ServeConfig<P>, SSRState)>,
request: Request<Body>,
) -> impl IntoResponse {
@@ -375,10 +375,18 @@ async fn convert_response(response: HyperResponse, res: &mut Response) {
}
}
struct SSRHandler<P: Clone> {
/// A handler that renders a Dioxus application to HTML using server-side rendering.
pub struct SSRHandler<P: Clone> {
cfg: ServeConfig<P>,
}
impl<P: Clone> SSRHandler<P> {
/// Creates a new SSR handler with the given configuration.
pub fn new(cfg: ServeConfig<P>) -> Self {
Self { cfg }
}
}
#[async_trait]
impl<P: Clone + serde::Serialize + Send + Sync + 'static> Handler for SSRHandler<P> {
async fn handle(