add tower live reload to auto refresh page on save
This commit is contained in:
parent
b26edbe0d1
commit
3a14b62c07
15
Cargo.lock
generated
15
Cargo.lock
generated
@ -1172,6 +1172,7 @@ dependencies = [
|
||||
"sqlx",
|
||||
"tokio",
|
||||
"tokio-stream",
|
||||
"tower-livereload",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -3109,6 +3110,20 @@ version = "0.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0"
|
||||
|
||||
[[package]]
|
||||
name = "tower-livereload"
|
||||
version = "0.9.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "61d6cbbab4b2d3cafd21fb211cc4b06525a0df919c3e8ca3d36485b1c1bd4cd4"
|
||||
dependencies = [
|
||||
"bytes",
|
||||
"http 1.1.0",
|
||||
"http-body 1.0.0",
|
||||
"pin-project-lite",
|
||||
"tokio",
|
||||
"tower",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tower-service"
|
||||
version = "0.3.2"
|
||||
|
@ -16,3 +16,4 @@ shuttle-shared-db = { version = "0.42.0", features = ["postgres", "sqlx"] }
|
||||
sqlx = { version = "0.7.2", features = ["runtime-tokio-rustls", "postgres"] }
|
||||
tokio = "1.28.2"
|
||||
tokio-stream = { version = "0.1.14", features = ["sync"] }
|
||||
tower-livereload = "0.9.2"
|
||||
|
@ -54,5 +54,7 @@ pub fn init_router() -> Router {
|
||||
.nest("/notes", init_notes_routes())
|
||||
.nest("/", init_utily_routes());
|
||||
|
||||
Router::new().nest("/", routes)
|
||||
Router::new()
|
||||
.nest("/", routes)
|
||||
.layer(tower_livereload::LiveReloadLayer::new())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user