Aino.Handler behaviour (aino v0.5.0)

Process an incoming request from Aino

The handle/1 function is passed an Aino.Token.

The handler must return a token that contains three keys to return a response:

  • :response_status
  • :response_headers
  • :response_body

If the token does not contain these three keys, a 500 error is returned.

Inside your handler, you may wish to use several Aino.Middleware including Aino.Middleware.common/0.

Link to this section Summary

Callbacks

Process an incoming request from Aino

Link to this section Callbacks

@callback handle(map()) :: map()

Process an incoming request from Aino

The argument is an Aino.Token.