Backend Routes - dmurchison/stuck_overclone_app GitHub Wiki

Rails API Routes

HTML

  • GET / - StaticPagesController#root

API Endpoints

users

  • GET /api/users Takes the user to their home page.
  • POST /api/users - Sign up a user.

session

  • POST /api/session - Login.
  • DELETE /api/session - Logout.

questions

  • GET /api/questions - Returns relevant question posts. (including answers)
  • GET /api/questions/:id - Returns entire question post. (including answers)
  • POST /api/questions - Creates a new question.
  • PATCH /api/questions/:id - Edit a question.
  • DELETE /api/questions/:id - Deletes a question.

upvotes

  • POST /api/upvotes - Upvote an answer.
  • DELETE /api/upvotes/:id - Remove upvote.

downvotes

  • POST /api/downvotes - Downvote an answer.
  • DELETE /api/downvotes/:id - Remove downvote.