class

Kamil::Engine::Server

Inherits Reference < Object

Development preview web server orchestrating the static site emitter, filesystem watcher, single-writer write pipeline, and SSE live reload hub.

Constructors

new(config : Kamil::Config, content_dir : Path | Nil = nil, layouts_dir : Path | Nil = nil, static_dir : Path | Nil = nil, output_dir : Path | Nil = nil, database_url : String | Nil = nil, host : String | Nil = nil, port : Int32 | Nil = nil, live_reload : Bool | Nil = nil, clean : Bool = false, output_io : IO = STDOUT, error_io : IO = STDERR)
Source

Instance methods

clean?
Source
config
Source
content_dir
Source
content_watcher
Source
database_url
Source
debounce_ms
Source
emitter
Source
error_io
Source
host
Source
layouts_dir
Source
layouts_watcher
Source
live_reload?
Source
output_dir
Source
output_io
Source
port
Source
resolve_target_file(raw_path : String, out_dir : String = @output_dir.to_s) : String | Nil

Resolves physical file path from clean request URL path with traversal bounds check.

Source
serve_target_file(env : HTTP::Server::Context, target_file : String | Path | Nil, raw_path : String, out_dir : String = @output_dir.to_s, is_live : Bool = @live_reload) : String

Serves resolved file or renders custom/fallback 404 response.

Source
setup_live_reload(pipeline : Persistence::WritePipeline, sentinel : Persistence::MemoryAntiEchoSentinel, emitter : Generator::SiteEmitter) : Nil

Initializes Live Reload hub and hooks watcher callbacks for automatic re-emission.

Source
setup_reconciler_and_emitter(store : Persistence::SqliteStore, sentinel : Persistence::MemoryAntiEchoSentinel, pipeline : Persistence::WritePipeline) : Generator::SiteEmitter

Reconciles database catalog and emits initial static distribution.

Source
start

Starts the server components and blocks on Kemal's HTTP listener.

Source
static_dir
Source
static_watcher
Source
stop

Gracefully shuts down background fibers and connections.

Source
watcher
Source