printing html as it is being streamed to client

This commit is contained in:
Jose Quesada 2022-12-18 16:52:12 -06:00
parent d79d4c4f86
commit 9d370776d2

View file

@ -33,6 +33,7 @@ async fn main() -> std::io::Result<()> {
|cx| view! { cx, <App/> }.into_view(cx),
))
.chain(futures::stream::once(async { tail.to_string() }))
.inspect(|html| println!("{html}"))
.map(|html| Ok(web::Bytes::from(html)) as Result<web::Bytes>),
)})
))