Fossil::Server
Inherits Reference < Object
Wrapper around HTTP::Server that holds the root Fossil::Router for the app.
Constructors
new(*, root_path : String = "", handlers : Indexable(HTTP::Handler) = [] of HTTP::Handler)
SourceInstance methods
close
Gracefully terminates the server. It will process currently accepted requests, but it won't accept new connections.
http_server
Sourcelisten(port : Int32, reuse_port : Bool = false)
Creates a TCPServer listening on 127.0.0.1:port, adds it as a socket
and starts the server. Blocks until the server is closed.
listen(host : String, port : Int32, reuse_port : Bool = false)
Creates a TCPServer listening on host:port, adds it as a socket
and starts the server. Blocks until the server is closed.
root
Source