Skip to content

API Routes

Moiz Ahmad edited this page Oct 7, 2021 · 1 revision

Users:

GET /api/users/

Gets all users

GET /api/users/:userId/

Gets a user by ID

Session:

GET /api/auth/

Gets the session user

POST /api/login/

Logs in a user

GET /api/auth/demo/

Logs in the demo user

GET /api/auth/logout/

Logs out the current user

POST /api/auth/signup/

Creates a new user

PUT /api/auth/edit/

Edits the current user

Attributes:

GET /api/attributes/

Gets all attributes

Feedback:

POST /api/feedback/

Creates new feedback for a recipe

PUT /api/feedback/:feedbackId/

Updates a user's feedback by ID

DELETE /api/feedback/:feedbackId/

Deletes a user's feedback by ID

Ingredients:

GET /api/ingredients/

Gets all ingredients

POST /api/ingredients/

Creates a new ingredient

Instructions:

POST /api/ionstructions/

Creates a new instruction

PUT /api/instructions/:instructionId/

Updates an instruction by ID

DELETE /api/instructions/:instructionId/

Deletes an instruction by ID

Pictures:

POST /api/pictures/

Uploads and creates a new picture

DELETE /api/pictures/:pictureId/

Deletes a picture from a recipe by ID

Ratings:

POST /api/ratings/

Creates a user rating on a recipe

PUT /api/ratings/:ratingId/

Updates a user's rating by ID

DELETE /api/ratings/:ratingId/

Deletes a user's rating by ID

Recipe Ingredients:

POST /api/recipe-ingredients/

Creates a recipe ingredient, with quantity, unitId, and ingredientId

PUT /api/recipe-ingredients/:recipeIngredientId/

Edits a recipe ingredient by ID

DELETE /api/recipe-ingredients/:recipeIngredientId/

Deletes a recipe ingredient by ID

Recipes:

GET /api/recipes/

Gets all recipes

GET /api/recipes/:recipeId/

Gets a recipe by ID

POST /api/recipes/

Creates a new recipe

PUT /api/recipes/:recipeId/

Updates a recipe by ID

DELETE /api/recipes/:recipeId/

Deletes a recipe by ID

POST /api/recipes/:recipeId/attributes/

Creates an attribute association for a recipe by ID

DELETE /api/recipes/:recipeId/attributes/:attributeId/

Deletes an attribute association from a recipe by ID

POST /api/recipes/:recipeId/types/

Creates a type association for a recipe by ID

DELETE /api/recipes/:recipeId/types/:typeId/

Deletes a type association from a recipe by ID

Types:

GET /api/types/

Gets all types

Units:

GET /api/units/

Gets all units

Clone this wiki locally