:- http_handler(root(api/login), login_route, []). % 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), reply_prolog(Reply).