Module cowboy_middleware

Behaviour for middlewares.

This module defines the cowboy_middleware behaviour.
Required callback functions: execute/2.

Description

Behaviour for middlewares.

Only one function needs to be implemented, execute/2. It receives the Req and the environment and returns them optionally modified. It can decide to stop the processing with or without an error. It is also possible to hibernate the process if needed.

A middleware can perform any operation. Make sure you always return the last modified Req so that Cowboy has the up to date information about the request.

Data Types

env()

env() = [{atom(), any()}]


Generated by EDoc, Aug 16 2014, 11:28:19.