Skip to content
Andy Wynkoop edited this page Apr 3, 2018 · 4 revisions

Routes

HTML

  • GET / StaticPagesController#root

API Endpoints

users
  • GET /api/users - get all users (for search)
  • GET /api/users/:id - get a single user (profile page)
  • POST /api/users - sign up
session
  • POST /api/session - log in
  • DELETE /api/session - log out
posts
  • GET /api/posts - get all posts (for friends of current_user only)
  • GET /api/users/:userId/posts - get all posts for a user (profile page)
  • POST /api/posts - create a new post
  • PATCH /api/posts/:id - edit a post
  • DELETE /api/posts/:id - delete a post
comments
  • GET /api/posts/:post_id/comments - get all comments for a post
  • POST /api/posts/:post_id/comments - create a comment on a post
  • PATCH /api/comments/:id - edit a comment
  • DELETE /api/comments/:id
message (Future Feature)
  • POST /api/chats/:userId - create a chat between current_user and target user
  • GET /api/chats/:id/messages - get all messages for a chat
  • POST /api/chats/:id/messages - send a new message!
  • No delete route - messages are permanent so say nice things to each other

Frontend Routes

  • / - login/Mainpage - handles new user sign up when logged out, renders news feed /MainPage when logged in
  • /:userId - user's profile page

Clone this wiki locally