https://family-recipes-app.herokuapp.com
Action | Method | Route | Body |
---|---|---|---|
Register/Create | POST | /api/auth/register | { username, email, password} |
Login | POST | /api/auth/login | {username, password} |
{
"username": "string",
"email": "string",
"password": "string"
}
{
"username": "string",
"password": "string"
}
{
"user_id":1,
"username":"john",
"message":"registration successful"
}
{
"user_id":1,
"username":"john",
"token":"JWTTokenHerehbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN0Ijo0LCJlbWFpbCI6ImdsQGRjLm9yZyIsIm",
"message":"login successful"
}
Action | Method | Route | Required |
---|---|---|---|
Fetch All Recipes of Users | GET | /api/:user_id/recipes | user_id |
Fetch Recipe | GET | /api/:user_id/recipes/:recipe_id | recipe_id and user_id |
Add New Recipe | POST | /api/:user_id/recipes | user_id |
Deletes Recipe | DELETE | /api/:user_id/recipes/:recipe_id | recipe_id and user_id |
Updates Recipe | PUT | /api/:user_id/recipes/:recipe_id | recipe_id and user_id |
{
"source":"string",
"category":"string; can be breakfast,lunch,dinner,dessert, or snack)",
"recipe_name":"string; unique",
"image_url":"URL",
"steps":[
{
"description":"string",
"ingredients":[
{
"ingredient_name":"string",
"amount":1,//numeric
"unit":"string"
},
{
"ingredient_name":"string",
"amount":2,//numeric
"unit":"string"
}
]
}
]
};
{
"user_id":1,
"recipe_id":1,
"source":"string",
"category":"string; can be breakfast,lunch,dinner,dessert, or snack)",
"recipe_name":"string; must be unique",
"image_url":"URL",
"steps":[
{
"description":"string",
"ingredients":[
{
"ingredient_name":"string",
"amount":2,
"unit":"string"
},
{
"ingredient_name":"string",
"amount":4,
"unit":"string"
}
]
}
]
};
//returns an array of recipes
{
"recipes" : []
}
{
"recipe_id":1,"message":"recipe updated successfully"
}
{
"recipe_id":1,"message":"recipe deleted successfully"
}