Skip to content

udhos/miniapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

license Go Report Card Go Reference Artifact Hub Docker Pulls

miniapi

miniapi

./build.sh

miniapi

test

curl localhost:8080/v1/world

# JSON
curl -d '{"hello":"world"}' -H 'account: 4321'  'localhost:8080/v1/hello?a=b' | jq

# multipart/form-data
curl -F param1=value1 -F param2=value2 'localhost:8080/v1/world?a=b' | jq

# application/x-www-form-urlencoded
curl -H "Content-Type: application/x-www-form-urlencoded" -d "param1=value1&param2=value2" 'localhost:8080/v1/world?a=b' | jq

test path parameter

# miniapi default route list is: ROUTE=/v1/hello;/v1/world;/card/{cardId}

curl -X DELETE localhost:8080/card/1234

Docker

Docker hub:

https://hub.docker.com/r/udhos/miniapi

Run from docker hub:

docker run -p 8080:8080 --rm udhos/miniapi:0.0.1

Build recipe:

./docker/build.sh

docker push -a udhos/miniapi

Helm chart

Using the repository

See https://udhos.github.io/miniapi/.

Create

mkdir charts
cd charts
helm create miniapi

Then edit files.

Lint

helm lint ./charts/miniapi --values charts/miniapi/values.yaml

Test rendering chart templates locally

helm template miniapi ./charts/miniapi --values charts/miniapi/values.yaml

Render templates at server

helm install miniapi ./charts/miniapi --values charts/miniapi/values.yaml --dry-run

Generate files for a chart repository

A chart repository is an HTTP server that houses one or more packaged charts. A chart repository is an HTTP server that houses an index.yaml file and optionally (*) some packaged charts.

(*) Optionally since the package charts could be hosted elsewhere and referenced by the index.yaml file.

docs
├── index.yaml
└── miniapi-0.1.3.tgz

See script update-charts.sh:

# generate chart package from source
helm package ./charts/miniapi -d ./docs

# regenerate the index from existing chart packages
helm repo index ./docs --url https://udhos.github.io/miniapi/

Install

helm install miniapi ./charts/miniapi --values charts/miniapi/values.yaml

Upgrade

helm upgrade miniapi ./charts/miniapi --values charts/miniapi/values.yaml

Uninstall

helm uninstall miniapi