Backend Routes - rd-tran/Bulletin GitHub Wiki

Backend Routes

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • GET /api/users - returns limited data
  • GET /api/users/:id - returns the corresponding user's information
  • POST /api/users - sign up
  • PATCH /api/users/:id - edit user information

session

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

posts

  • GET /api/posts/ - returns relevant posts including their comments (filtered by data/params)
  • GET /api/posts/:id - returns the post
  • POST /api/posts - creates a post
  • PATCH /api/posts/:id - edit a post
  • DELETE /api/posts/:id - remove a post

comments

  • POST /api/comments - creates a comment on the corresponding post
  • PATCH /api/comments - updates a comment on the corresponding post
  • DELETE /api/comments/:id - deletes a comment on the corresponding post

likes

  • POST /api/likes - like a post/comment
  • DELETE /api/likes - unlike a post/comment