Skip to content

backend routes

Sam edited this page Feb 26, 2019 · 6 revisions

Backend Routes

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns the user information of displayed posts and for the User Search feature

  • POST /api/users - sign up

session

  • GET /api/session/new - log in page

  • POST /api/session - log in

  • DELETE /api/session - log out

posts

  • GET /api/posts - returns relevant posts (filtered by data/params)

  • GET /api/posts/:id - returns post

  • POST /api/posts - creates a post

  • DELETE /api/posts/:id - remove a post

likes

  • POST /api/posts/:post_id/likes - like a post

  • DELETE /api/posts/:post_id/likes - unlike a post

comments

  • GET /api/posts/:post_id/comments - returns relevant comments (filtered by post_id)

  • POST /api/posts/comment - creates a comment

  • DELETE /api/posts/comment/:id - remove a comment

follows

  • GET /api/user/:user_id/follows - returns list of followers

  • POST /api/user/:user_id - follow a user

  • DELETE /api/posts/:user_id/follows - unfollow a user

Clone this wiki locally