Kamil::Engine::Server
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)
SourceInstance methods
clean?
Sourceconfig
Sourcecontent_dir
Sourcecontent_watcher
Sourcedatabase_url
Sourcedebounce_ms
Sourceemitter
Sourceerror_io
Sourcehost
Sourcehub
Sourcelayouts_dir
Sourcelayouts_watcher
Sourcelive_reload?
Sourceoutput_dir
Sourceoutput_io
Sourceport
SourceResolves physical file path from clean request URL path with traversal bounds check.
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.
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.
setup_reconciler_and_emitter(store : Persistence::SqliteStore, sentinel : Persistence::MemoryAntiEchoSentinel, pipeline : Persistence::WritePipeline) : Generator::SiteEmitter
Reconciles database catalog and emits initial static distribution.
static_dir
Sourcestatic_watcher
Sourcewatcher
Source