Webs_cli
Command line interface support.
val listener : ?opts:string list -> ?docs:string -> ?default_port:int ->
?default_listener:Webs_unix.listener -> unit -> Webs_unix.listener Cmdliner.Term.t
listener
is an option for specifying a connection listener.
default_port
is the default port when unspecified (defaults to 8000
).default_listen
is the default listener when unspecified (defaults to `Host ("localhost", default_port)
).docs
is the section where the option is documented.opts
are the options to use (defaults to ["l";"listen"]
).docroot
is an option for specifying an optional document root.
docs
is the section where the option is documented.opts
are the options to use (defaults to ["d";"docroot"]
).val quick_serve : ?version:string -> ?man:Cmdliner.Manpage.block list -> ?doc:string ->
name:string -> Webs.service -> unit
quick_serve ~name (Ok s)
runs s
with the Webs_httpc
and handles a few default command line options. If you want to be able to specify a docroot on the command line you need to specify with_docroot:true
. There is no default for docroots it always needs to be specified explicitely.
val quick_serve' : ?version:string -> ?man:Cmdliner.Manpage.block list -> ?doc:string ->
name:string -> conf:('a, string) Stdlib.result Cmdliner.Term.t -> ('a -> Webs.service) -> unit
quick_serve'
is like quick_serve
but additional configuration parameters can be parsed from the command line and be checked before installing the service.