Skip to content

backend routes

Jerry Park edited this page May 13, 2022 · 4 revisions

Backend Routes

HTML

  • GET / - StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns the user information of displayed chirps and for the User Search feature
  • POST /api/users - sign up

session

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

posts

  • GET /api/posts - returns relevant posts (filtered by data/params)
  • GET /api/posts/:id - returns post
  • POST /api/posts - creates a post
  • PATCH /api/posts/:id - edit a post
  • DELETE /api/posts/:id - remove a post

comments

  • POST /api/comments - create a comment
  • PATCH /api/comments/:id - edit a comment

votes

  • POST /api/votes - vote for a post
  • DELETE /api/votes/:id - unvote the post
Clone this wiki locally