Compare commits
1 Commits
2eba7c5e10
...
c342d922a7
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c342d922a7 |
@ -15,6 +15,7 @@ fn not_htmx_predicate<T>(req: &Request<T>) -> bool {
|
|||||||
async fn main() {
|
async fn main() {
|
||||||
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||||
let assets_path = Path::new(&manifest_dir).join("assets");
|
let assets_path = Path::new(&manifest_dir).join("assets");
|
||||||
|
let templates_path = Path::new(&manifest_dir).join("templates");
|
||||||
|
|
||||||
let livereload = LiveReloadLayer::new();
|
let livereload = LiveReloadLayer::new();
|
||||||
let reloader = livereload.reloader();
|
let reloader = livereload.reloader();
|
||||||
@ -22,7 +23,7 @@ async fn main() {
|
|||||||
let router = get_router(assets_path.as_path()).layer(livereload.request_predicate(not_htmx_predicate));
|
let router = get_router(assets_path.as_path()).layer(livereload.request_predicate(not_htmx_predicate));
|
||||||
|
|
||||||
let mut watcher = notify::recommended_watcher(move |_| reloader.reload()).unwrap();
|
let mut watcher = notify::recommended_watcher(move |_| reloader.reload()).unwrap();
|
||||||
watcher.watch(&Path::new(&manifest_dir).join("templates"), notify::RecursiveMode::Recursive).unwrap();
|
watcher.watch(&templates_path, notify::RecursiveMode::Recursive).unwrap();
|
||||||
|
|
||||||
let mut listenfd = ListenFd::from_env();
|
let mut listenfd = ListenFd::from_env();
|
||||||
let listener = match listenfd.take_tcp_listener(0).unwrap() {
|
let listener = match listenfd.take_tcp_listener(0).unwrap() {
|
||||||
|
Loading…
Reference in New Issue
Block a user