Skip to content

Backend Routes

j-corp-25 edited this page Jul 19, 2023 · 1 revision

HTML

  • GET / StaticPagesController#root

API EndPoints

users

  • POST /api/users - User registration (Sign Up)
  • GET /api/users/${user_id} - get specific user data (Profile)
  • PATCH /api/users/${user_id} - Update user information (Profile Edit)
  • DELETE /api/users/${user_id} - Delete user (Account Deletion)

session

  • POST /api/session - User login
  • DELETE /api/session - User logout

videos

  • GET /api/videos - All videos
  • GET /api/videos/${id} - Specific video
  • POST /api/videos - Upload a video
  • PATCH /api/videos/${id} - Edit video properties
  • DELETE /api/videos/${id} - Remove specific video

likes

  • POST /api/videos/${id}/like - Likes the current video
  • DELETE /api/videos/${id}/like - Unlikes the current video

dislikes

  • POST /api/videos/${id}/dislike - Dislikes the current video
  • DELETE /api/videos/${id}/dislike - Un-dislikes the current video

comments

  • GET /api/videos/${id}/comments - Show comments under the specific video
  • POST /api/videos/${id}/comments - Post a comment under the specific video
  • DELETE /api/videos/${id}/comments/${comment_id} - Delete a comment

subscriptions

  • GET /api/users/${user_id}/subscriptions - Show all subscriptions of a user
  • POST /api/users/${user_id}/subscriptions - Subscribe to another user
  • DELETE /api/users/${user_id}/subscriptions/${subscribed_to_id} - Unsubscribe from another user
Clone this wiki locally