API Documentation - Ashley-B1/Rabbit-Hole GitHub Wiki

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.

Comments

A logged in user may

  • Navigate to a user’s posts/:postId page and be able to:
  • Write a new comment
  • POST /api/posts/:postId/comments
  • Edit a comment they have already written
  • PUT /api/comments/:commentId
  • Delete a comment they have already written
  • DELETE /api/comments/:commentId
  • These actions will not redirect the user

Likes

A logged in user may

  • Navigate to a user’s posts/:postId page and be able to:
  • Like a post
  • POST /api/posts/:id/likes
  • Remove their own like from a post
  • DELETE /api/posts/:id/likes