Skip to content

Backend Routes

bryandevelops edited this page Jul 28, 2019 · 7 revisions

Backend Routes

HTML

  • "GET" / StaticPagesController#root

API Endpoints

Users

  • "POST" /api/users API::UsersController#new
    • Sign-up

Session

  • "POST" /api/session API::SessionsController#create
    • Log-in
  • "DELETE" /api/session API::SessionsController#destroy
    • Log-out

Stories

  • "GET" /api/stories API::StoriesController#index
    • Retrieve all stories
  • "GET" /api/stories/:id API::StoriesController#show
    • Retrieve single story based on story id
  • "POST" /api/stories API::StoriesController#create
    • Create a new story
  • "PATCH" /api/stories/:id API::StoriesController#update
    • Update an existing story based on story id
  • "DELETE" /api/stories/:id API::StoriesController#destroy
    • Remove a story based on story id

Responses

  • "POST" /api/stories/:story_id/responses API::ResponsesController#create
    • Create new response for a specific story
  • "PATCH" /api/stories/:story_id/responses API::ResponsesController#update
    • Update an existing response left under a specific story
  • "DELETE" /api/stories/:story_id/responses API::ResponsesController#destroy
    • Delete an existing response left under a specific story

Follows

  • "POST" /api/users/:user_id/follows
    • Follow a specific user
  • "DELETE" /api/follows/:id
    • Unfollow a specific user based on the follows id

Claps

  • "POST" /api/stories/:story_id/claps
    • Clap for a specific story
  • "DELETE" /api/claps/:id
    • Remove a specific clap based on the claps id
Clone this wiki locally