Compare commits
No commits in common. "35082a748be6fbe6a0010774e4b4556fe9e4d278" and "e4ab8223865d75dac930d49c91d0317823198423" have entirely different histories.
35082a748b
...
e4ab822386
@ -25,6 +25,10 @@ init(Req0, Opts) ->
|
||||
}, Resp, Req1),
|
||||
{ok, Req2, Opts}.
|
||||
|
||||
%% 健康检查
|
||||
handle_request("GET", "/api/health_check", _) ->
|
||||
{ok, 200, <<"OK">>};
|
||||
|
||||
%% 场地信息
|
||||
handle_request("POST", "/api/device_info/storeInfo", ReqBody) when is_binary(ReqBody) ->
|
||||
#{<<"storeInfos">> := StoreInfos} = jiffy:decode(ReqBody, [return_maps]),
|
||||
|
||||
@ -1,19 +0,0 @@
|
||||
%%%-------------------------------------------------------------------
|
||||
%%% @author licheng5
|
||||
%%% @copyright (C) 2020, <COMPANY>
|
||||
%%% @doc
|
||||
%%%
|
||||
%%% @end
|
||||
%%% Created : 26. 4月 2020 3:36 下午
|
||||
%%%-------------------------------------------------------------------
|
||||
-module(health_handler).
|
||||
-author("licheng5").
|
||||
|
||||
%% API
|
||||
-export([init/2]).
|
||||
|
||||
init(Req0, Opts) ->
|
||||
Req1 = cowboy_req:reply(200, #{
|
||||
<<"Content-Type">> => <<"text/plain">>
|
||||
}, <<"OK">>, Req0),
|
||||
{ok, Req1, Opts}.
|
||||
@ -35,8 +35,7 @@ start_http_server() ->
|
||||
|
||||
Dispatcher = cowboy_router:compile([
|
||||
{'_', [
|
||||
{"/api/device_info/[...]", api_handler, []},
|
||||
{"/health_check", health_handler, []}
|
||||
{"/api/device_info/[...]", api_handler, []}
|
||||
]}
|
||||
]),
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user