Backend Routes - juniprs/gat-mcprath GitHub Wiki

HTML

  • GET /StaticPagesController#root

API Endpoints

users

  • GET /api/users/:id - return the user's own information if the user is logged in (user's show page)
  • POST /api/users - sign up user

session

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

products

  • GET /api/products - return all product listings
  • GET /api/products/:id - return selected product

cart

  • (only available when the specific user is logged in)
  • GET /api/cart/:id - return the user's cart
  • POST /api/cart/:id - add product to cart
  • PATCH /api/cart/:id/ - update the quantity of a specific product in the cart
  • DELETE /api/cart/:id/ - remove a specific product from the cart