backend routes - adammoftah/Stack-Overwhelm GitHub Wiki

Backend Routes

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns user information comprising questions asked, questions answered, and for the user search functionality
  • POST /api/users - sign up a new user

session

  • POST /api/session - sign in a user
  • DELETE /api/session - sign out a user

questions

  • GET /api/questions - returns questions filtered by data or params
  • GET /api/questions/:id - returns a question with a given ID
  • POST /api/questions - creates a question
  • PATCH /api/questions/:id - edits a question
  • DELETE /api/questions/:id - removes a question

answers

  • GET /api/questions/answers - returns all answers to a specified question
  • GET /api/answers/:id - returns a specific answer to a question
  • POST /api/answers - creates an answer
  • PATCH /api/answers/:id - edits an answer
  • DELETE /api/answers/:id - removes an answer

favorites

  • POST /api/questions/:question_id/favorites - favorite a question
  • DELETE /api/questions/:question_id/favorites - remove favorite of a question

votes

  • POST /api/answers/:answer_id/votes - submit either an upvote or downvote
  • DELETE /api/answers/:answer_id/votes - remove either an upvote or downvote

search

GET /api/search - returns questions that relate to a search query

⚠️ **GitHub.com Fallback** ⚠️