mist

Functions

pub fn run_service(port: Int, handler: fn(Request(BitString)) ->
    Response(BitBuilder)) -> Result(Nil, StartError)

Runs an HTTP Request->Response server at the given port, with your defined handler.

pub fn serve(port: Int, handler: fn(
    HandlerMessage,
    LoopState(State),
  ) -> Next(LoopState(State))) -> Result(Nil, StartError)

Slightly more flexible alternative to run_service. This allows hooking into the mist/http.{handler_func} method.