Module rama::http::layer

source ·
Expand description

Http Layers provided by Rama.

A Layer, as defined in crate::service, is a middleware that can modify the request and/or response of a Services. It is also capable of branching between two or more Services.


  • auth: A layer that can be used to authenticate requests, branching in case the request is not authenticated (read: rejected).
  • cors: A layer that can be used to add CORS headers to the response.

Most layers are implemented as a Service, and then wrapped in a Layer. This is done to allow the layer to be used as a service, and to allow it to be composed with other layers.