package jerboa

  1. Overview
  2. Docs

Jerboa.Path_handler module consists of the type definition of the Path_handler and an easy to use constructor.

type t = {
  1. meth : Meth.t;
  2. path_mapping : Path_mapping.t;
  3. request_handler : Request_handler.t;
}

Path_handler.t is the type of the path handler, which will be used to handle a specific request.

Path_handler.create meth path_mapping request_handler is a constructor for path handler records, which work based on:

  • meth: http method to match
  • path_mapping: path mapping to used for matching the request's path
  • request_handler: handler, which will transform the request into a response
val handle_path_handler : t -> Request.t -> Response.t
val apply_path_handler : t option -> Request.t -> (Request.t -> Response.t) -> Response.t
OCaml

Innovation. Community. Security.