module

Plombir::CLI::Serve

Shared --port/--host handling and blocking serve loop for the dev and preview commands (roadmap Phase 2, item 1).

Class methods

parse(args : Array(String), default_port : Int32, error : IO, usage : String) : Options | Nil

Parses the options shared by dev and preview. Prints the usage error and returns nil when the arguments are invalid.

Source
run(config : Plombir::Server::Config, label : String, io : IO, error : IO) : Int32

Binds the port and blocks serving until SIGINT/SIGTERM. A taken port is a project error (exit 1) carrying the exact --port hint string from Server::PortInUse.

Source

Nested types