diff --git a/index.php b/index.php index fda4685..b172924 100644 --- a/index.php +++ b/index.php @@ -68,4 +68,11 @@ $app->post("/createingredients", function (array $req, Response $res) use ($db) $res->send("New ingredient has been listed "); }); +$app->post("/createunits", function (array $req, Response $res) use ($db) { + $newUnit = $req["body"]["unit"]; + $db->insert("folla", ["unita" => "$newUnit"]); + + $res->send("New unit has been listed "); +}); + $app->start(); \ No newline at end of file