Skip to content

Backend Routes

jrogergordon edited this page Aug 12, 2022 · 5 revisions

Backend Routes

HTML

  • GET- StaticPagesController#root

API Endpoints

users

  • GET /api/users/:userId - returns user show page, including all user's posts
  • POST /api/users - sign up

sessions

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

posts

  • GET /api/posts - return all posts
  • GET /api/post/:id - return a post
  • POST /api/posts - create a post
  • PATCH /api/posts/:id - edit a post
  • DELETE /api/posts/:id - remove a post

likes

  • POST /api/posts/:post_id/likes - like a post
  • DELETE /api/posts/:post_id/likes - unlike a post

follows

  • POST /api/users/:user_id/follows - follow a user
  • DELETE /api/users/:user_id/follows - unfollow a user

Clone this wiki locally