routes - lisza/storie GitHub Wiki
-
GET /api/users/:idusers#show- Returns author profile, with a feed of that author's stories -
POST /api/users/users#create- Sign up -
PATCH /api/users/:idusers#update- Edit profile
-
GET /api/storiesstories#index- Returns a feed of all stories, or some filtered version thereof -
GET /api/stories/:idstories#show- Returns a single story -
POST /api/storiesstories#create- Create a new story -
PATCH /api/stories/:idstories#update- Edit story -
DELETE /api/stories/:idstories#delete- Remove story
Question: What happened to our stories#new and users#new routes?
-
POST /api/stories/:story_id/commentscomments#create- Post new comment -
DELETE /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
-
POST api/likeslikes#create- Like a story -
DELETE 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
-
POST api/followsfollows#create- Follow author -
DELETE 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?
-
/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