Backend - Neminem1203/Me-Cube GitHub Wiki

Backend Routes


HTML

  • GET / StaticPagesController#root - Root Page (will be overwritten in frontend)

API Endpoints

users

  • GET /api/users/ - Get a list of user info (requires params[:user_list] to be an array of integers to return all the user information)
  • POST /api/users - Create User
  • GET /api/users/:user_id - Shows info from the user with the :user_id
  • PATCH /api/users/:user_id - Edit User Information (Authorized User Only)
  • DELETE /api/users/:user_id - Delete Account (Authorized User Only)

session

  • POST /api/session - Sign In
  • DELETE /api/session - Sign Out

videos

  • GET /api/videos - All Videos
  • POST /api/videos - Upload Video
  • GET /api/videos/:video_id - Watch Videos
  • PATCH /api/videos/:video_id - Edit Video (Authorized Users Only)
  • DELETE /api/videos/:video_id - Remove Video (Authorized Users Only)

comments

  • GET /api/videos/comments/ - Get Comments for Video
  • POST /api/comments/ - Create New Comment
  • PATCH /api/comments/:comment_id - Edit Comment (Authorized Users Only)
  • DELETE /api/comments/:comment_id - Delete Comment (Authorized Users Only)

likes

  • GET /api/videos/:video_id/likes - Get all the likes for a video_id
  • GET /api/comments/:comment_id/likes - Get all the likes for a comment_id
  • POST /api/likes - Create a Like/Dislike on a likeable item
  • DELETE /api/likes/:like_id - Remove Like/Dislike