fyni/route

Types

pub type Handler(user) =
  fn(context.Context(user)) -> response.Response(wisp.Body)
pub type Route(user) {
  Route(
    method: http.Method,
    path: String,
    handler: fn(context.Context(user)) -> response.Response(
      wisp.Body,
    ),
  )
}

Constructors

Values

pub fn handle(
  route: Route(user),
  user: Result(user, Nil),
  request: request.Request(wisp.Connection),
) -> response.Response(wisp.Body)
pub fn match(
  route: Route(user),
  request: request.Request(wisp.Connection),
) -> Bool
pub fn new(
  method method: http.Method,
  path path: String,
  handler handler: fn(context.Context(user)) -> response.Response(
    wisp.Body,
  ),
) -> Route(user)
pub fn path_segments(route: Route(user)) -> List(String)
Search Document