Starship.warp_in
You're seeing just the function
warp_in
, go back to Starship module for more information.
Specs
warp_in() :: pid()
Starts the Starship webserver with the default configuration.
The default configuration listens on port 4000, with wildcard handlers that receive requests for any host,
Starship.Handler.Wildcard.Http
and Starship.Handler.Wildcard.Websocket
.
Examples
iex> pid = Starship.warp_in()
iex> is_pid(pid)
true
iex> Process.exit(pid, :closed)
Specs
Starts the webserver with the desired configuration.
The config
passed to this function should be a map
containing any configurations that you would like to
start your webserver with.
Examples
iex(1)> config =
...(1)> %{
...(1)> ip: {0, 0, 0, 0},
...(1)> port: 4000,
...(1)> hosts: %{
...(1)> {:http, "*"} => {Starship.Handler.Wildcard.Http, %{}},
...(1)> {:ws, "*"} => {Starship.Handler.Wildcard.Websocket, %{}}
...(1)> },
...(1)> ssl_opts: nil
...(1)> }
%{
ip: {0, 0, 0, 0},
port: 4000,
hosts: %{
{:http, "*"} => {Starship.Handler.Wildcard.Http, %{}},
{:ws, "*"} => {Starship.Handler.Wildcard.Websocket, %{}}
},
ssl_opts: nil
}
iex(2)> pid = Starship.warp_in(config)
iex(3)> is_pid(pid)
true
iex(4)> Process.exit(pid, :closed)