gleam/http/elli

Functions

pub fn become(
  service: fn(Request(BitArray)) -> Response(BytesBuilder),
  on_port number: Int,
) -> Result(Nil, Dynamic)

Start an Elli web server with the current process.

This function returns if the Elli web server fails to start or if it was shut down after successfully starting.

pub fn start(
  service: fn(Request(BitArray)) -> Response(BytesBuilder),
  on_port number: Int,
) -> Result(Pid, Dynamic)

Start a new Elli web server process which runs concurrently to the current process.

If you want to run the web server but don’t need to do anything else with the current process you may want to use the become function instead.

Search Document