diff --git a/routes/products.pl b/routes/products.pl deleted file mode 100644 index 03fcd8f..0000000 --- a/routes/products.pl +++ /dev/null @@ -1,19 +0,0 @@ -:- http_handler( - root(products), - products_page, - [] -). - -% POST /products -products_page(Request) :- - member(method(post), Request), !, - http_read_data(Request, Json, []), - json_to_prolog(Json, product(Name, Price)), - assert_product(Name, Price), - reply_json(Json). - -% GET /products -products_page(_Request) :- - bagof(product(Name, Price), product(Name, Price), Products), - prolog_to_json(Products, Json), - reply_json(Json, []).