Skip to content

Backend Routes

Nathan edited this page Mar 9, 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.

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 '/api/users/:userId/posts'
    • POST '/api/posts'
    • PUT '/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.

    • GET '/api/posts/:postId/likes'
    • POST '/api/posts/:postId/likes'
    • DELETE '/api/likes/:likesid'

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.

    • GET '/api/posts/:postId/comment'
    • 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

    • GET '/api/users/:userId/followers'
    • POST '/api/users/:userId/followers'
    • DELETE '/api/followers/:followerId'

Clone this wiki locally