Sign inSign up

cakebakery/products

By cakebakery

•Updated over 5 years ago

Products - Sample Backend

Image
0

182

cakebakery/products repository overview

⁠1.1. Run in Docker
$ docker run -d -p 8080:8080 --name products-backend cakebakery/products:v1

Resource Usage

resources:
  limits:
    cpu: "5m"
    memory: "20Mi"
  requests:
    cpu: "2m"
    memory: "10Mi"
⁠Swagger Documentation
⁠Sample cURL
curl -X 'GET' \
  'http://localhost:8080/products' \
  -H 'accept: application/json'
[
    {
        "id": 1,
        "name": "Apples",
        "category": "Food",
        "price": 149
    },
    {
        "id": 2,
        "name": "Macaroni and Cheese",
        "category": "Food",
        "price": 769
    },
    {
        "id": 3,
        "name": "ABC Smart TV",
        "category": "Electronics",
        "price": 39999
    },
    {
        "id": 4,
        "name": "Motor Oil",
        "category": "Automobile",
        "price": 2288
    },
    {
        "id": 5,
        "name": "Floral Sleeveless Blouse",
        "category": "Clothing",
        "price": 2150
    }
]

Other sample cURL

curl -X 'POST' \
  'http://localhost:8080/products' \
  -H 'accept: application/json' \
  -H 'Content-Type: applicatoin/json' \
  -d '{
  "id": 3,
  "name": "ABC Smart TV",
  "category": "Electronics",
  "price": 39999
}'
curl -X 'GET' \
  'http://localhost:8080/products/3' \
  -H 'accept: application/json'
curl -X 'PUT' \
  'http://localhost:8080/products/3' \
  -H 'accept: application/json' \
  -H 'Content-Type: applicatoin/json' \
  -d '{
  "id": 3,
  "name": "ABC Smart TV",
  "category": "Electronics",
  "price": 39999
}'
curl -X 'DELETE' \
  'http://localhost:8080/products/3' \
  -H 'accept: application/json'
⁠Remove running service
docker rm -f products-backend

⁠Source

https://github.com/cake-baker/products⁠

Tag summary

Content type

Image

Digest

Size

3.6 MB

Last updated

over 5 years ago

docker pull cakebakery/products:v1