Skip to content

API Routes

Renerose Dimatulac edited this page Jun 13, 2021 · 3 revisions

API Routes

  • This web app uses the following API routes to dynamically update the page.

users

  • GET /api/users/:id - User Profile
  • POST /api/users - Sign Up
  • PATCH /api/users/:id - Edit User Profile

session

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

posts

  • GET /api/posts/ - Fetch all posts
  • POST /api/posts/ - Create a post
  • PATCH /api/posts/:post_id - Edit a post
  • DELETE /api/posts/:post_id - Delete a post

comments

  • GET /api/comments/ - Fetch all comments
  • POST /api/comments/ - Create a comment
  • PATCH /api/comments/:comment_id - Edit a comment
  • DELETE /api/comments/:comment_id - Delete a comment

friends

  • POST /api/friends - Send a friend request
  • DELETE /api/friends/:fr_id - Delete a friend or cancel a friend request

likes

  • GET /api/likes - Fetch all likes
  • POST /api/posts/:post_id/likes - like a post
  • POST /api/comments/:comment_id/likes - like a comment
  • DELETE /api/likes/:id - unlike a post or a comment

Clone this wiki locally