API Routes - michellekontoff/spudhub GitHub Wiki

API-Routes

This web app uses the following API routes to dynamically update the page to create a single-page-app-like feel for the user for specific features.

User

  • GET /api/users/:id

  • POST /api/users/:id

  • DELETE /api/users/:id

Products

  • A logged in and logged out user can get list of visible products without causing a refresh/redirect.

    • GET /api/products/
  • A logged in user may create a product listing without causing a refresh/redirect.

    • POST /api/products/:id
  • A logged in user may update the details of products they listed without refreshing the page.

    • UPDATE /api/products/:id
  • A logged in user may delete one of their own products, removing it from the list of visible products without causing a refresh/redirect.

    • DELETE /api/products/:id

Shopping Cart

  • Uses a combination of cookies and the store. Doesn't access the database.

  • Logged in users can edit their shopping cart without causing a refresh.