Skip to content
ChrisCavs edited this page Jul 5, 2018 · 6 revisions

Routes

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns user information for search feature and stories authors
  • GET /api/users/:id - returns user (for profile)
  • GET /api/users/:id/feed - returns stories based on user follows
  • POST /api/users - sign up
  • PATCH /api/users/:id - edits user profile

session

  • POST /api/session - log in
  • DELETE /api/session - log out

stories

  • GET /api/stories - returns relevant stories (filtered by data/params)
  • GET /api/stories/:id - returns story
  • GET /api/stories/popular - returns 5 popular stories, based on karma
  • POST /api/stories - creates a story
  • PATCH /api/stories/:id - edit a story
  • DELETE /api/stories/:id - remove a story

comments

  • GET /api/comments - returns relevant comments (filtered by data/params)
  • GET /api/comments/:id - returns comment
  • POST /api/comments - creates a comment
  • PATCH /api/comments/:id - edit a comment
  • DELETE /api/comments/:id - remove a comment

likes

  • POST /api/stories/:story_id/likes - like a story
  • DELETE /api/stories/:story_id/likes - unlike a story
  • POST /api/comments/:comment_id/likes - like a comment
  • DELETE /api/comments/:comment_id/likes - unlike a comment

follows

  • POST /api/users/:user_id/follow - follow a user
  • DELETE /api/users/:user_id/follow - unfollow a user

Frontend Routes

  • / - Homepage
  • /feed - user feed (based on follows)
  • /users/:userId - user profile
  • /stories/new - create a story
  • /stories/:storyId - story show
  • /stories/:storyId/edit - update a story
Clone this wiki locally