Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

Backend Routes

Jon Tran edited this page Nov 15, 2020 · 6 revisions

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns users information of uploaded videos and for the Search feature
  • POST /api/users - account creation
  • GET /api/users/results?search_query=${user_input} - returns users that match the search query

session

  • POST /api/session - log in
  • DELETE /api/session - log out

videos

  • GET /api/videos - returns videos filtered by data/params
  • GET /api/videos/:id - returns a video
  • POST /api/videos - upload a video
  • PATCH /api/videos/:id - update a video's info
  • DELETE /api/video/:id - delete a video
  • GET /api/videos/results?search_query=${user_input} - returns videos that match the search query

comments

  • GET /api/videos/:video_id/comments - return comments from the associated video
  • POST /api/videos/:video_id/comments - create a comment for the associated video
  • PATCH /api/comments/:id - edit a comment
  • DELETE /api/comments/:id - delete a comment

votes

  • POST /api/videos/:video_id/likes - like or dislike a video
  • POST /api/comments/:comment_id/upvote - upvote or downvote a comment
  • DELETE /api/videos/:video_id/likes/:id - delete a like or dislike

views (bonus)

  • POST /api/videos/:video_id/views - adds a view for the associated video

channels (bonus)

  • POST /api/channels - create a channel
  • PATCH /api/channels/:channel_id -edit a channel

subscriptions (bonus)

  • POST /api/users/:user_id/subscriptions - subscribe to a channel
  • DELETE /api/users/:user_id/subscriptions/:id - unsubscribe from a channel
Clone this wiki locally