Backend Routes - aishnair22/aura-beauty GitHub Wiki

HTML

  • GET / StaticPagesController#root

API Endpoints

users

  • NB: will access the user's profile through state.currentUser
  • POST /api/users - sign up

session

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

products

  • GET /api/products - returns all products
  • GET /api/products/:product_id - returns specific product

categories

  • GET /api/categories - returns all categories

cart

  • POST /api/carts - create a cart

cart_items

  • GET /api/cart_items - returns all the cart_items of the current user
  • POST /api/cart_items - creates cart item
  • PATCH /api/cart_items/:cart_item_id - edit item in cart (ex: when a user edits the quantity)
  • DELETE /api/cart_items/:cart_item_id - remove a cart item
  • DELETE /api/cart_items#destroy_all - remove all cart items of current user (when user checks out)