Skip to content

Backend Routes

Nathan edited this page Mar 13, 2023 · 6 revisions

API-Routes

This web app uses the following API routes to dynamically update the page to create a single-page-app-like feel for the user for specific features.

User

  • A user can create an account, login, and logout

    • POST '/api/auth/signup'
    • POST '/api/auth/login'
    • ANY '/api/auth/logout'

Profiles

  • Users will be able to see other users and their own profile data

    • GET '/api/users'
    • GET '/api/users/<userId>'

Posts

  • A logged in user can create a post

  • A logged in user can update and delete their own post

  • Users can view posts

  • Users can view a specific user's posts

    • GET '/api/posts'
    • GET/POST '/api/users/<userId>/posts'
    • PUT/PATCH '/api/posts/<postId>'
    • DELETE '/api/posts/<postId>'

Likes

  • A logged in user can like or unlike a post with visible confirmation without causing a refresh/redirect.

    • POST '/api/posts/<postId>/likes'
    • DELETE '/api/likes/<likeId>'

Comments

  • A logged in user may delete one of their own comments, removing it from the list of visible comments without causing a refresh/redirect.

    • POST '/api/posts/<postId>/comment'
    • PUT 'api/posts/<postId>/comment
    • DELETE '/api/comments/<commentId>'

Follows

  • A logged in user can follow and unfollow other users

  • A logged in user can see their followers

    • POST '/api/users/<userId>/followers'
    • DELETE '/api/followers/<userId>'
Clone this wiki locally