API Documentation - StevenBarnett1/Group_Project 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.

Users

  • A logged in user may see their user profile, create a user, edit their information, or delete their account without causing a refreshing/redirect.
    • POST /api/users
    • PUT /api/users/:id
    • DELETE /api/users/:id

Questions

  • A logged in user may see all of the questions posted, add questions, navigate to a specific question, edit a specific question, and delete a specific question without causing a refreshing/redirect.
    • POST /api/
    • PUT /api/questions/:id
    • DELETE /api/questions/:id

Answers

  • A logged in user may see all the answers posted to an answer, navigate to a specific answer, add answers to a specific question, edit a specific answer, and delete a specific answer without causing a refreshing/redirect.
    • POST /api/questions/:questionId/answers
    • PUT /api/answers/:answerId
    • DELETE /api/answers/:answerId

Comments

  • A logged in user may see all the comments posted to an answer, navigate to a specific comment, add comments to a specific answer, edit a specific comment, and delete a specific comment without causing a refreshing/redirect.

    • POST /api/answers/:answerId/comments
    • PUT /api/comments/:commentId
    • DELETE /api/comments/:commentId

Votes

  • A logged in user may add an upvote to a specific question, change the upvote to a downvote, and delete the upvote without causing a refreshing/redirect.
    • POST /api/questions/:questionId/votes
    • PUT /api/questions/:questionId/votes/:voteId
    • DELETE /api/questions/:questionId/votes/:voteId