Skip to content

AutoDataSmith/javascript-coffee-shop-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Start Quide

The coffeeshop_backend API can be tested with the POSTMAN application.

Deployment and Configuration

Set up a hosting account using Render

RENDER INSTRUCTIONS

The Products API

Test 1: GET https://coffeeshop-backend-4qlh.onrender.com/api/products

  • Returns the list of all products

Test 2: POST https://coffeeshop-backend-4qlh.onrender.com/api/products

  • adds 1 or more products
  • returns a list of saved and/or invaild products

Add 1 Product:

sample post data: - This should return a saved product

    { "productCode": "RSA01", "name": "Roasted Almonds", "price": 7.99, "category": "snacks" } 

Add multiple Products:

sample post data: only index 1 is valid - index 0, 2, 3 should return a specific validation error

[   
    { "productCode": "RSA01", "name": "Roasted Almonds", "price": 7.99, "category": "snacks" },
    { "productCode": "CCO01", "name": "Choc Chip Cookie", "price": 1.29, "category": "bakery" },
    { "productCode": "STI01", "name": "Titan Stickers", "price": 1.29, "category": "stuff" },
    { "productCode": "TCP01", "name": "Titan Cap", "price": 0, "categoryz": "merch" }
]

Test 3: PUT https://coffeeshop-backend-4qlh.onrender.com/api/products/PRODUCTCODE

sample put data:

    { "name": "Roasted Almonds", "price": 7.99, "category": "snacks" } 

Test 4: DELETE https://coffeeshop-backend-4qlh.onrender.com/api/products/PRODUCTCODE

The Orders API

Test 1: POST https://coffeeshop-backend-4qlh.onrender.com/api/orders

  • adds 1 or more orders
  • returns a list of saved and/or invaild orders

Add 1 Order: sample post data: - This should return a saved order

    {"productCode":"TEE01","size":"large","quantity":2}

Add multiple Orders: // sample post data: - Indexes 2,3, and 4 should fail validation bad quantity, Bad Code, and bad size

[
    {"productCode":"CCO01","size":"large","quantity":10},
    {"productCode":"TRM01","size":"small","quantity":3},
    {"productCode":"LAT01","size":"small","quantity":0},   
    {"productCode":"xxz01","size":"small","quantity":1},
    {"productCode":"TEE01","size":"xxl","quantity":1}
]

Test 2: GET https://coffeeshop-backend-4qlh.onrender.com/api/orders

  • Returns the list of all orders

Test 3: PUT https://coffeeshop-backend-4qlh.onrender.com/api/products/ID

sample put data:

    {"size":"small","quantity":1 } 

Test 4: DELETE https://coffeeshop-backend-4qlh.onrender.com/api/orders/ID

About

JavaScript backend coursework project demonstrating server-side logic, routes, data handling, and API-style support for a coffee shop application.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors