Routes - lisza/storie GitHub Wiki
API Endpoints
users
GET /api/users/:idusers#show- Returns author profile, with a feed of that author's storiesPOST /api/users/users#create- Sign upPATCH /api/users/:idusers#update- Edit profile
stories
GET /api/storiesstories#index- Returns a feed of all stories, or some filtered version thereofGET /api/stories/:idstories#show- Returns a single storyPOST /api/storiesstories#create- Create a new storyPATCH /api/stories/:idstories#update- Edit storyDELETE /api/stories/:idstories#delete- Remove story
Question: What happened to our stories#new and users#new routes?
comments
POST /api/stories/:story_id/commentscomments#create- Post new commentDELETE /api/comments/:idcomments#destroy- Remove comment
Note: We don't need GET comments#index and POST comments#new routes for comments, because both routes render the stories#show view via views/api/stories/show.json.jbuilder
likes
POST api/likeslikes#create- Like a storyDELETE api/likeslikes#destroy- Unlike a story
Note: Both actions render views/api/stories/show.json.jbuilder so we don't need GET methods for likes#index or likes#show
follows
POST api/followsfollows#create- Follow authorDELETE api/followsfollows/destroy- Unfollow author
Note: Both actions render views/api/users/show.json.jbuilder so we don't need GET methods for follows#index or follows#show
Question: We don't need to provide an :id to the destroy action? Are we gonna look it up by current_user and shown user?
Frontend Routes
/loginand/signup/feed- Homepage, main story feed/users/:userId- Author profile with feed of only that author's stories/users/:userId/edit- Edit author profile/stories/new- Create new story/stories/:storyId- Show single story/stories/:storyId/:edit- Edit story/comments/new- Add a comment/comments- Show all comments for a story