-
Notifications
You must be signed in to change notification settings - Fork 0
API Documentation
Meitong Qu edited this page Nov 16, 2021
·
5 revisions
-
GET api/auth/- authenticates a user. -
POST api/auth/login- logs a user in. -
GET api/auth/logout- logs a user out. -
POST api/auth/signup- creates a new user and logs them in. -
GET api/auth/unauthorized- returns unauthorized JSON when flask-login authentication fails.
-
GET api/users/- get all users -
GET api/users/:userId- get the user by Id. -
POST api/users/:userId- edit the user's profile. -
DELETE api/users/:userId- delete the user.
-
GET api/recipes/- get all recipes. -
GET api/recipes/recent- get most recently created 5 recipes. -
GET api/recipes/previous- get all recipes ordering from newest to oldest created at times. -
GET api/recipes/:recipeId- get the recipe per ID. -
GET api/recipes/my_plage/:recipeId- get all comments liked by the logged-in user. -
GET api/recipes/tag- get all recipes with same tag.
-
POST api/recipes- create new recipe and its associate tags, ingredients, instructions, media. -
GET api/recipes/edit/:recipeId- get an edit form, with pre-filled information of recipe and its associate tags, ingredients, instructions, media. -
POST api/recipes/edit/:recipeId- edit recipe and its associate tags, ingredients, instructions, media. -
DELETE api/recipes/delete/:recipeId- delete recipe and its associate tags, ingredients, instructions, media.
-
GET api/recipes/comments- get all comments. -
POST api/recipes/comments- create comments. -
PATCH api/recipes/comments/:commentId- edit a comment. -
DELETE api/recipes/comments/:commentId- delete a comment.
-
POST api/likes/:recipeId- create likes to the recipe if there is no like by the current user, otherwise unlike it. -
GET api/likes/:recipeId- check if the recipe is liked by the logged-in user. -
GET api/likes/- get all likes.
-
GET api/search/:searchTerm- return search result of recipes per searchTerm
-
GET api/tags/- return all tags joined with recipes -
GET api/tags/random- return all tags joined with recipes in a random order.
October 2021 Johnny Park, Meitong Qu, Darren Via II, Jami Travers