Quenya.Plug.RoutePlug (Quenya v0.3.8) View Source

Plug for executing a route. To use it:

get "/todo/:todoId", to: Quenya.Plug.RoutePlug, init_opts: [
  preprocessors: [{RequestValidatorPlug, []}],
  postprocessors: [{ResponseValidatorPlug, []}],
  handlers: [{RouteHandler, []}]
])

Note this plug shall be used after Plug.Parsers since it will access request body (if any)

Options

  • :preprocessors - a list of plugs, execute in order before executing handlers
  • :handlers - a list of plugs to process request and generate response
  • :postprocessors - a list of plugs that will be executed in order before send

Link to this section Summary

Functions

Callback implementation for Plug.call/2.

Callback implementation for Plug.init/1.

Link to this section Functions

Specs

call(Plug.Conn.t(), keyword()) :: Plug.Conn.t()

Callback implementation for Plug.call/2.

Specs

init(keyword()) :: keyword()

Callback implementation for Plug.init/1.