Backend Routes - rachanavishwanath/DueTube GitHub Wiki

API Endpoints


users

  • GET /api/users/ - returns user information of all expenses
  • POST /api/users/ - sign up

session

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

videos

  • GET api/videos/ - fetches all videos
  • GET api/videos/:video_id - fetches specific video
  • POST api/videos/ - creates a new video
  • PATCH api/videos/:video_id - updates existing video
  • DELETE api/videos/:video_id - deletes existing video

playlists

  • GET api/playlists/ - fetches all playlists
  • GET api/playlists/:playlist_id - fetches one playlist
  • POST api/playlists/ - creates a new playlists
  • PATCH api/playlists/:playlist_id - update existing playlist
  • DELETE api/playlists/:playlist_id - delete existing playlist

views

  • GET api/videos/:video_id/views/ - fetches views for a video
  • PATCH api/videos/:video_id/views/ - updates views for a video

likes

  • GET api/videos/:video_id/likes - gets all likes details of the expense
  • POST api/videos/:video_id/like - create a like for the video
  • DELETE api/videos/:video_id/unlike - deletes a like for the video
  • POST api/videos/:video_id/dislike - create a dislike for the video
  • DELETE api/videos/:video_id/undislike - deletes a dislike for the video
  • PATCH api/videos/:video_id/toggle_like - toggle between like and dislike

comments

  • GET api/videos/:video_id/comments - gets all comments on a video
  • PATCH api/videos/:video_id/comments/:comment_id - updates comment
  • DELETE api/videos/:video_id/comments/:comment_id - deletes a comment