From 8d0b13a3039ed087ff5dfe341dda60f3744abd5c Mon Sep 17 00:00:00 2001 From: Sijmen Schoon Date: Fri, 1 Nov 2019 00:23:00 +0100 Subject: [PATCH] maybe it does --- routes/products.pl | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 routes/products.pl 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, []).