Skip to content

Backend Routes

AlbertgitC edited this page Oct 10, 2019 · 8 revisions

Backend Routes

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns the user information of displayed feeds and for the User Search feature
  • GET /api/users/:id - returns single user
  • POST /api/users - sign up
  • PATCH /api/users/:id - edits a user info

session

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

feeds

  • GET /api/feeds - returns relevant feeds (filtered by data/params)
  • GET /api/feeds/:id - returns feed by id
  • POST /api/feeds - creates new feed
  • PATCH /api/feeds/:id - edits a feed
  • DELETE /api/feeds/:id - removes a feed

comments

  • GET /api/feeds/:feed_id/comments - returns comments under a feed
  • POST /api/feeds/:feed_id/comments - creates new comment
  • PATCH /api/feeds/:feed_id/comments/:id - edits a comment
  • DELETE /api/feeds/:feed_id/comments/:id - removes a comment

likes

  • POST /api/feeds/:feed_id/likes - like a feed
  • DELETE /api/feeds/:feed_id/likes - unlike a feed
  • POST /api/feeds/:feed_id/comments/:comment_id/likes - like a comment
  • DELETE /api/feeds/:feed_id/comments/:comment_id/likes - unlike a comment

Clone this wiki locally