hot reloading with tower-livereload #457
-
Hi use salvo::prelude::*;
use tokio::time::Duration;
use tower_livereload::LiveReloadLayer;
#[handler]
async fn hello() -> &'static str {
"Hello World"
}
#[tokio::main]
async fn main() {
tracing_subscriber::fmt().init();
let hotreload = LiveReloadLayer::new().compat();
let acceptor = TcpListener::new("0.0.0.0:5800").bind().await;
let router = Router::new().hoop(hotreload).get(hello);
Server::new(acceptor).serve(router).await;
} Compiler complains
is there a trait i need to included ? I assume LiveReloadLayer is just a normal tower layer and it should work with salve. Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
chrislearn
Oct 17, 2023
Replies: 1 comment 1 reply
-
Salvo is base on |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
gengjun
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Salvo is base on
hyper
1.0 rc4, it usehttp-body
is version 1.0.0-rc2, buttower-livereload
usehttp-body
version is 0.4.5.