init(Req, State) -> {cowboy_loop, Req, State} | {cowboy_loop, Req, State, hibernate} info(Info, Req, State) -> {ok, Req, State} | {ok, Req, State, hibernate} | {stop, Req, State} terminate(Reason, Req, State) -> ok %% optional Req :: cowboy_req:req() State :: any() Info :: any() Reason :: stop | {crash, error | exit | throw, any()}