Backend Routes - Tdon95/Center GitHub Wiki

Backend Routes


HTML

  • GET / StaticPagesController#root

API Endpoints

Users

  • POST /api/users - Signs up a user
  • GET /api/users/:user_id - Returns a users articles, and all information of the user

Session

  • POST /api/session - Logs in a user
  • DELETE /api/session - Logout a user

Stories

  • GET /api/stories/ - Return all the articles
  • GET /api/stories/:story_id - Returns a specific article
  • POST /api/stories/ - Will create a new article
  • PATCH /api/stories/:story_id - Edits an article description
  • DELETE /api/stories/:story_id - Deletes an article

Responses

  • POST /api/articles/:article_id/responses - Adds a response to an article
  • DELETE /api/responses/:response_id - Will remove a response
  • Edit /api/users/:user_id/responses - Can edit/change what user has written in a response

Follow

  • POST /api/users/:user_id/follow - Will start following a user
  • DELETE /api/users/:user_id/follow - Will stop following a user

Claps

  • POST /api/stories/:story_id/claps - Add a clap to a story
  • DELETE /api/stories/story_id/claps - Will remove a clap from a story