2019-11-03 01:05:33 +00:00
|
|
|
:- http_handler(root(api/login), login_route, []).
|
2019-11-01 00:13:23 +00:00
|
|
|
|
|
|
|
% POST /login
|
|
|
|
login_route(Request) :-
|
|
|
|
member(method(post), Request), !,
|
|
|
|
http_read_data(Request, Json, []),
|
|
|
|
json_to_prolog(Json, login(Username, Password)),
|
|
|
|
handle_login(Username, Password, Reply),
|
2019-11-03 01:05:33 +00:00
|
|
|
reply_prolog(Reply).
|