gleam/http/service

Types

Deprecated: Use middleware packages such as Wisp or Glen instead

@deprecated("Use middleware packages such as Wisp or Glen instead")
pub type Middleware(
  before_req,
  before_resp,
  after_req,
  after_resp,
) =
  fn(fn(Request(before_req)) -> Response(before_resp)) ->
    fn(Request(after_req)) -> Response(after_resp)

Deprecated: Use middleware packages such as Wisp or Glen instead

@deprecated("Use middleware packages such as Wisp or Glen instead")
pub type Service(in, out) =
  fn(Request(in)) -> Response(out)

Functions

pub fn map_response_body(
  service: fn(a) -> Response(b),
  with mapper: fn(b) -> c,
) -> fn(a) -> Response(c)

Deprecated: Use middleware packages such as Wisp or Glen instead

pub fn method_override(
  service: fn(Request(a)) -> b,
) -> fn(Request(a)) -> b

Deprecated: Use middleware packages such as Wisp or Glen instead

pub fn prepend_response_header(
  service: fn(a) -> Response(b),
  key: String,
  value: String,
) -> fn(a) -> Response(b)

Deprecated: Use middleware packages such as Wisp or Glen instead

Search Document