nova_handler behaviour (nova v0.14.3)

View Source

Summary

Callbacks

init/2

-callback init(Req, any()) -> {ok | module(), Req, any()} | {module(), Req, any(), any()}
                  when Req :: cowboy_req:req().

terminate/3

(optional)
-callback terminate(any(), map(), any()) -> ok.

Functions

execute(Req, Env)

-spec execute(Req, Env) -> {ok, Req, Env} when Req :: cowboy_req:req(), Env :: cowboy_middleware:env().

terminate(Reason, Req, Callback)

-spec terminate(any(), Req :: cowboy_req:req() | undefined, function()) -> ok.