Refactor structure

This commit is contained in:
2026-04-23 09:59:53 +03:00
parent 081dcf9588
commit c154ceac39
6 changed files with 1 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
-module(admin_handler_health).
-export([init/2]).
init(Req, _Opts) ->
case cowboy_req:method(Req) of
<<"GET">> ->
Body = jsx:encode(#{status => <<"ok">>}),
Req1 = cowboy_req:reply(200, #{<<"content-type">> => <<"application/json">>}, Body, Req),
{ok, Req1, []};
_ ->
Body = jsx:encode(#{error => <<"Method not allowed">>}),
Req1 = cowboy_req:reply(405, #{<<"content-type">> => <<"application/json">>}, Body, Req),
{ok, Req1, []}
end.