1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
//! A tiny web dev server with live reload, written in Rust.
//! Usable as a CLI (`webadev`) or as a library.
//!
//! ## Features
//!
//! - Serve a static folder (HTML/CSS/JS)
//! - Live reload in the browser on file change (debounced by 200ms)
//! - CSS hot-reload (no full page reload)
//! - Smart script injection (no manual setup needed)
//! - Auto-reconnect (reloads the page when the server restarts)
//! - Custom IP/port support
//! - Add headers
//!
//! ## Library
//!
//! From simplest to most control.
//!
//! ### 1. Static serving
//!
//! See the runnable example on [`Server::new`].
//!
//! Use `0` as `config.port` to let the OS pick a free port
//! (the chosen port is visible in `server.url`).
//!
//! ### 2. With live reload
//!
//! See the runnable example on [`Server::bind`].
//!
//! The `broadcast` channel notifies subscribers of reload events `(ReloadType, Vec<PathBuf>)`:
//! - [`ReloadType::Css`] (CSS-only) or [`ReloadType::Page`] (full reload),
//! - The changed paths.
//!
//! ### 3. Advanced: merge routes, TLS, graceful shutdown
//!
//! Use the low-level [`bind`] and [`serve`] to compose with your own axum router.
//! See the runnable example on [`bind`].
//!
//! ## CLI
//!
//! Install with `cargo install webadev`, then `webadev` in a folder serves it
//! With live reload. See the
//! [README](https://github.com/francoisromain/webadev) for all options.
// Be strict with our own docs: every public item should be documented
/// How to reload a browser tab on file change
pub use ;
pub use watch;