Skip to content

Backend Routes

aciffone23 edited this page May 28, 2023 · 3 revisions

Backend Routes

HTML

  • GET / - StaticPagesController#FrontendIndex

API Endpoints

users

  • POST /api/register - register user

session

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

products

  • GET /api/products - show all products
  • GET /api/products/:id - show product info

cart

  • GET /api/cart/ - gets shopping cart
  • POST /api/cart/ - adds product to cart
  • PATCH /api/cart/ - updates what is in cart
  • DELETE /api/cart/ - Removes product in cart
  • POST /api/cart/checkout - checkout process

reviews

  • GET /api/products/:id/reviews - get all reviews for product
  • POST /api/products/:id/reviews - review on specific product
  • PATCH /api/reviews/:id - edit review
  • DELETE /api/reviews/:id: - delete review

search

  • GET /api/search - products based on search

Clone this wiki locally