-
Login: [POST]
/api/login
checks users login credentials against the database -
Register: [POST]
/api/register
tests users credentials against the db and stores it[GET] /api/recipes
returns an array of recipes (or an empty array if there aren't any).[GET] /api/recipes/:id
returns a recipe by the given id.[POST] /api/recipes
returns the created recipe.[PUT] /api/recipes/:id
returns the updated recipe.[DELETE] /api/recipes/:id
returns the deleted recipe.
(Back-end: Create Seeds & Migration tables using Knex) Please remember it is critical that you create your state exactly as you see the JSON output above, otherwise, you will not be able to access the db.
field | data type |
---|---|
username | string, required |
password | string, required |
-
returned JSON example:
{
"username": "Wrenley", "password": "Willow1357"
}
field | data type |
---|---|
username | string, required |
password | string, required |
string, not required |
-
returned JSON example:
{
"username": "Wrenley", "password": "Willow1357", "email": "[email protected]"
}
field | data type | metadata |
---|---|---|
id | unsigned integer | primary key, auto-increments, generated by database |
title | string | required, unique |
source | string | required |
ingredients | string | required |
instructions | array | required |
category | string | optional |
- returned JSON example:
recipes
[
{
"id": 1,
"title": "Kumandra Stew",
"source": "Raya and Sisu",
"ingredients": "water, ginger, noodles, tumeric, lemonzest",
"instructions": ["directly infuse compassion and perspective", "Add 2 cups of water"],
"category": "soups & stews"
},
{
"id": 2,
"title": "Lasagna",
"source": "Luca",
"ingredients": "pasta, marinara, mozzarella",
"instructions": ["hop on your vespa", "ride into town to buy cheese", "boil water"],
"category": "pasta"
}
]