wisp/wisp_mist

Values

pub fn handler(
  handler: fn(request.Request(//internal)) -> response.Response(
    wisp.Body,
  ),
  secret_key_base: String,
) -> fn(request.Request(//internal)) -> response.Response(
  mist.ResponseData,
)

Convert a Wisp request handler into a function that can be run with the Mist web server.

Examples

pub fn main() {
  let secret_key_base = "..."
  let assert Ok(_) =
    handle_request
    |> wisp_mist.handler(secret_key_base)
    |> mist.new
    |> mist.port(8000)
    |> mist.start_http
  process.sleep_forever()
}
Search Document