Skip to content

API Routes

Alejandro Carrizosa Grant edited this page Jan 4, 2022 · 1 revision

API-Routes

This web app uses the following API routes that will be handled by the backend flask server and its interaction with the database

Posts

  • A logged in user can add a new post
    • POST api/posts
  • A logged in user can edit a post's description
    • PATCH api/posts/<int:postId>
  • A logged in user can delete a post
    • DELETE api/posts/<int:postId>

Likes

  • A logged in user can like a post
    • POST api/likes
  • A logged in user can unlike a post
    • DELETE api/likes/<int:likeId>

Comments

  • A logged in user can comment on a post
    • POST api/comments
  • A logged in user can edit a comment's description on a post
    • PATCH api/comments/<int:commentId>
  • A logged in user can delete a comment
    • DELETE api/posts/<int:commentId>

Users

  • A non-logged in user can sign up to create an account
    • POST api/auth/signup
  • A non-logged in user can login to a pre-existing account
    • POST api/auth/login
  • A logged in user can logout of their account
    • GET api/auth/logout
  • A logged in user can be authenticated
    • GET api/auth
  • A user that fails to login will receive an Unauthorized error message
    • GET api/auth/unauthorized

Followers

  • A user can follow another user
    • POST api/follows
  • A user can unfollow another user
    • DELETE api/follows/<int:followId>
Clone this wiki locally