Skip to content

Latest commit

 

History

History

quickstart

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Quickstart Demo

This demo runs GONK, two demo upstream services, and Prometheus.

Prerequisite: Docker Compose v2 (docker compose).

Start

docker compose -f examples/quickstart/docker-compose.yml up --build

GONK listens on http://localhost:8080. Prometheus listens on http://localhost:9090.

Try A Public Route

curl http://localhost:8080/public/ping

Generate A Demo JWT

docker compose -f examples/quickstart/docker-compose.yml run --rm --entrypoint gonk-cli gonk \
  auth jwt generate \
  --role user \
  --scopes read:api \
  --user-id demo-user \
  --expiry 24h

Copy the token from the command output, then call the protected route:

TOKEN="<paste-token-here>"
curl -H "Authorization: Bearer $TOKEN" http://localhost:8080/api/ping

Useful Endpoints

curl http://localhost:8080/_gonk/health
curl http://localhost:8080/_gonk/info
curl http://localhost:8080/metrics

Stop

docker compose -f examples/quickstart/docker-compose.yml down --remove-orphans

Smoke Test

make demo-smoke

The smoke test starts the stack, calls a public route, generates a JWT, calls a protected route, checks metrics, and then tears the stack down.