leptus
Types
Listener = http | https Handlers = [{HostMatch, [{module(), State :: any()}]}] HostMatch = term() StaticDir = file:name() | {priv_dir, App :: atom(), Dir :: file:name()} Option = {ip, inet:ip_address()} | {port, inet:port_number()} | {num_acceptors, non_neg_integer()} | {cacertfile, file:name_all()} | {certfile, file:name_all()} | {keyfile, file:name_all()} | {static_dir, {HostMatch, StaticDir}} | {log_handlers, [{module(), any()}]} Options = [Option]
Functions
start_listener/2
Starts a listener of type Listener
.
leptus:start_listener(Listener, HandlersOrApp) -> {ok, pid()} App = atom() HandlersOrApp = Handlers | App
Note that if you specify App
, Leptus will try to evaluate
App/priv/leptus.config
file which should contain:
{handlers, Handlers}. {options, Options}.
start_listener/3
leptus:start_listener(Listener, Handlers, Options) -> leptus:start_listener(Listener, Handlers, Options, #{})
start_listener/4
Starts a listener of type Listener
.
leptus:start_listener(Listener, Handlers, Options, CowboyProtoOpts) -> {ok, pid()} CowboyProtoOpts = cowboy:opts()