backend routes - rlachivirus/WEbook GitHub Wiki

HTML

  • GET / StaticPagesController#root

API Endpoints

Users

  • GET /api/users - returns all users
  • GET /api/users/:id - returns a user
  • PATCH /api/users/:id - updates a user
  • DELETE /api/users/:id - delete a user
  • POST /api/users - sign up

Session

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

Posts

  • POST /api/posts - creates a post
  • PATCH /api/posts/:id - edits a post
  • DELETE /api/posts/:id - deletes a post

Comments

  • POST /api/posts/:post_id/comments - creates a comment on a post
  • POST /api/comments/:comment_id - creates a comment on a comment
  • PATCH /api/comments/:id - edits a comment
  • DELETE /api/comments/:id - deletes a comment

Likes

  • POST /api/posts/:postId/like - likes a post
  • POST /api/comments/:commentId/like - likes a comment
  • DELETE /api/likes/:id - deletes a like from a post or comment

Friends

  • POST /api/friend - sends a friend request
  • DELETE /api/friend/:id - deletes a friend from a user's friends list