}); $app->get('/getIngredientByPrix/:prix', function ($prix) { //renvoi les infos de l'ingredient dont le prix est < ou = $ingredient = Ingredient::getIngredientByPrix($prix); }); $app->get('/getIngredientByCategorie/:categorie', function ($categorie) { //renvoi tous les ingredients de la catégorie $ingredient = Ingredient::getIngredientByCategorie($categorie); }); $app->get('/getAllIngredient', function () { //renvoi tous les ingredients $ingredient = Ingredient::getAllIngredient(); }); $app->get('/getIngredientByRecette/:recetteId', function ($recetteId) { //renvoi les ingrédients de la recette $ingredient = Ingredient::getIngredientByRecette($recetteId); }); $app->post('/AddIngredient', function () { //Ajoute un ingredient $ingredient = Ingredient::AddIngredient($_POST["nom"], $_POST["prix"], $_POST["unite"]); }); $app->put('/ModifIngredient', function () { //Ajoute un ingredient $ingredient = Ingredient::ModifIngredient($_POST["nom"], $_POST["prix"], $_POST["unite"], $_POST["id"]); }); $app->delete('/DelIngredient', function () { //Ajoute un ingredient $ingredient = Ingredient::DelIngredient($_POST["id"]); }); /*-------------------------------------------------- CATEGORY