Skip to content

Latest commit

 

History

History
89 lines (72 loc) · 2.73 KB

README.md

File metadata and controls

89 lines (72 loc) · 2.73 KB

recipes

Project Description:

Hyperskill - Recipes

Cloud Deployment:

https://recipes-app.azurewebsites.net/

Features:

  • Only authenticated user can add, view, search recipes.
  • Only owner can edit, delete a recipe.

User:

{
   "email": "[email protected]",
   "password": "RecipeInBinary"
}

Recipe:

{
   "name": "Fresh Mint Tea",
   "category": "beverage",
   "description": "Light, aromatic and refreshing beverage, ...",
   "ingredients": ["boiled water", "honey", "fresh mint leaves"],
   "directions": ["Boil water", "Pour boiling hot water into a mug", "Add fresh mint leaves", "Mix and let the mint leaves seep for 3-5 minutes", "Add honey and mix again"]
}

Routes:

GET /api/recipe/{id}
GET /api/recipe/search?category={category}
GET /api/recipe/search?name={name}

POST /api/register
POST /api/recipe/new

DELETE /api/recipe/{id}

PUT /api/recipe/{id}

Sample requests:

curl -X POST https://recipes-app.azurewebsites.net/api/register \
     -H 'Content-Type: application/json' \
     -d '{
          "email": "[email protected]",
          "password": "12345678"
        }'

curl -X POST https://recipes-app.azurewebsites.net/api/recipe/new \
     -H 'Content-Type: application/json' \
     -u '[email protected]:12345678' \
     -d '{
           "name": "Fresh Mint Tea",
           "category": "beverage",
           "description": "Light, aromatic and refreshing beverage, ...",
           "ingredients": ["boiled water", "honey", "fresh mint leaves"],
           "directions": ["Boil water", "Pour boiling hot water into a mug", "Add fresh mint leaves", "Mix and let the mint leaves seep for 3-5 minutes", "Add honey and mix again"]
         }'

curl -X GET https://recipes-app.azurewebsites.net/api/recipe/11 \
     -u '[email protected]:12345678'

curl -X GET https://recipes-app.azurewebsites.net/api/recipe/search?category=beverage \
     -u '[email protected]:12345678'

curl -X GET https://recipes-app.azurewebsites.net/api/recipe/search?name=Fresh%20Mint%20Tea \
     -u '[email protected]:12345678'

curl -X DELETE https://recipes-app.azurewebsites.net/api/recipe/10 \
     -u '[email protected]:12345678'

curl -X  PUT https://recipes-app.azurewebsites.net/api/recipe/11 \
     -H 'Content-Type: application/json' \
     -u '[email protected]:12345678' \
     -d '{
           "name": "Mint Tea",
           "category": "beverage",
           "description": "refreshing beverage",
           "ingredients": ["boiled water", "honey", "fresh mint leaves"],
           "directions": ["Boil water", "Pour boiling hot water into a mug", "Add fresh mint leaves", "Mix and let the mint leaves seep for 3-5 minutes", "Add honey and mix again"]
         }'