Skip to content

Backend Routes

Jamie An edited this page Nov 19, 2021 · 2 revisions

Backend Routes

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users/:id - Returns the information of a single user
  • POST /api/users - Sign up

session

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

posts

  • GET /api/posts - Returns all relevant posts for Post Search feature
  • GET /api/posts/:id - Returns post
  • POST /api/posts - Creates new post
  • PATCH /api/posts/:id - Edits post
  • DELETE /api/posts/:id - Deletes post

comments

  • GET /api/comments/:id - Returns comment
  • POST /api/comments - Creates new comment
  • PATCH /api/comments/:id - Edits comment
  • DELETE /api/comments/:id - Deletes comment

votes

  • POST /api/votes - Up/down vote a post/comment
  • DELETE /api/votes/:id - Remove your vote on a post/comment

saves

  • POST /api/saves - Save a post/comment
  • DELETE /api/saves/:id - Unsave a post/comment

follows

  • POST /api/follows - Follow a community
  • DELETE /api/follows/:id - Unfollow a community

communities

  • GET /api/communities - Returns all communities for Community Search feature
  • GET /api/communities/:id - Returns a community
  • POST /api/communities - Creates a new community
  • PATCH /api/communities/:id - Edits a community
  • DELETE /api/communities/:id - Deletes a community

search

  • GET /api/search - Searches users and communities for user input

Clone this wiki locally