Live reload script injection and handling. Adapted from Dream.livereload middleware. This version is not a middleware so it's not as plug-and-play as that, but on the other hand it's much simpler to implement because it uses type-safe dream-html nodes rather than parsing and printing raw HTML. See below for the 3-step process to use it.
(3) And run the server with environment variable LIVERELOAD=1.
⚠️ If this env var is not set, then livereload is turned off. This means that the route will respond with 404 status and the script will be omitted from the rendered HTML.