API Documentation - DavidPhamThinkful/Life-Overflow 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.

Answers

  • Anyone can view answers on their respective question page and see its body and vote counters.
    • GET /api/questions/:id/answers
    • GET /api/answers/:id
  • A logged in user may create an answer and seeing it populate directly on the questions page without causing a refresh/redirect.
    • POST /api/questions/:id/answers
  • A logged in user may edit an answer and see it change directly on the questions page without causing a refresh/redirect.
    • PUT /api/answers/:id
  • A logged in user may delete an answer and see it be removed directly on the questions page without causing a refresh/redirect.
    • DELETE /api/answers/:id

Votes

  • A logged in user may cast a vote, change their vote, or remove their vote on an answer and see the vote counter change directly on the questions page without causing a refresh/redirect.
    • PUT /api/answers/:id/votes