Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 1.09 KB

README.md

File metadata and controls

39 lines (32 loc) · 1.09 KB

API Documentation for ComputerShop Backend

Auth

  1. /api/v1/login POST: Create auth token for session
  2. /api/v1/register POST: Create new user and get auth token
  3. /api/v1/logout POST: Logout the current session and destroy token

Users

User Information (Send access token in header)

  1. /api/v1/users
    • GET: Get all the users in database
  2. /api/v1/users/profile
    • GET: Get the user info
    • PATCH: Update the user
    • DELETE: Delete the user

User Cart

  1. /api/v1/users/cart

    • GET: Get cart contents of user
    • POST: Add product to cart
  2. /api/v1/users/cart/:prod_id

    • PATCH: Update product in cart
    • DELETE: Delete product from cart

User Orders

  1. /api/v1/users/orders

    • GET: Get previous orders
    • POST: Create new order
  2. /api/v1/users/orders/:order_id

    • GET: Get previous order details

Products

  1. /api/v1/products
    • GET: Get all products from database
  2. /api/v1/products/:id
    • GET: Get specified product from database