MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / inject_livereload

Function inject_livereload

cli/src/serve.rs:86–91  ·  view source on GitHub ↗
(html: &str)

Source from the content-addressed store, hash-verified

84</script>"#;
85
86fn inject_livereload(html: &str) -> String {
87 match html.rfind("</body>") {
88 Some(i) => format!("{}{}{}", &html[..i], LIVERELOAD, &html[i..]),
89 None => format!("{html}{LIVERELOAD}"),
90 }
91}
92
93/// Bump `version` whenever any file under `dir` changes. Mtime poll, no watcher dependency.
94fn spawn_watcher(dir: PathBuf, version: Arc<AtomicU64>) {

Callers 1

serve_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected