Skip to content

backend routes

Roger Hu edited this page Feb 9, 2021 · 15 revisions

Backend Routes

HTML

  • GET / StaticPagesController#root

API Endpoitns

users

  • GET /api/users - returns the user's information
  • POST /api/users - sign up

session

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

products

  • GET /api/products - returns all product listings
  • GET /api/products/:id - returns detailed view of a product listing

reviews

  • POST /api/reviews/ - create new review
  • PATCH /api/reviews/:id - edit existing review
  • DELETE /api/reviews/:id - delete existing review

cart_items

  • Post /api/cart_items/ - create cart item when user clicks on "add to cart"
  • PATCH /api/cart_items/:id - update cart items (quantity)
  • DELETE /api/cart_items/:id - delete cart items
Clone this wiki locally