class

Plombir::Server::Handler

Inherits HTTP::Handler < Reference < Object

One HTTP::Handler serving files under a root directory: / and directory paths resolve to index.html inside them, anything else must name an existing file, otherwise the 404.html page (or a plain fallback) is served with status 404.

With a LiveReload::Reloader, dev additionally serves the SSE event stream and injects the reload snippet into .html pages. Without one (preview), files go out byte-identical to disk.

Constructors

new(root : String, reloader : LiveReload::Reloader | Nil = nil)
Source

Instance methods

call(context : HTTP::Server::Context) : Nil
Source