Skip to content

Backend Routes

AlbertgitC edited this page Oct 11, 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
  • GET /api/users/:user_id/feeds - returns all feeds authored by a user

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/comments/:id - edits a comment
  • DELETE /api/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/comments/:comment_id/likes - like a comment
  • DELETE /api/comments/:comment_id/likes - unlike a comment

follows

  • GET /api/users/:user_id/followers/follows - returns user's followers
  • GET /api/users/:user_id/following/follows - returns user's following
  • POST /api/users/:user_id/follows - follows an user
  • DELETE /api/users/:user_id/follows - unfollows an user

Clone this wiki locally