Wellcome, workshop is a demonstration environment that puts together the necessary pieces to get you started with our API Gateway, using an example web application.
API gateway, we have added to the environment both the API (backend) that feeds the gateway and a website consuming the api gateway. Additionally, a dashboard with the metrics is also available so you can see your activity.
The docker-compose starts the following services:
The consumer of the API gateway is a simple Express JS application that interacts with KrakenD to fetch the data. All code is under web/
.
The client is a Single Page Application using Auth0 to generate JWT tokens.
You don't need to install any npm locally, the docker image will download and install the dependencies in the container for you.
Runs on http://localhost:3000
A simple API that provides raw data to the gateway.
You can add or remove data any time by adding XML, JSON or RSS files in the data
folder.
Runs on http://localhost:8000
An instance of Krakendesigner (the GUI for manipulating the api-gw/krakend.json
file.
You can drag the file api-gw/krakend.json
anytime in the dashboard and resume the edition from there.
Runs on http://localhost:8787
An instance of KrakenD with several endpoints. Its configuration is in the folder api-gw/
.
Runs on http://localhost:5001
A Jaeger dashboard shows the traces of the activity you generate. Runs on http://localhost:16686
A Prometheus gathers the metrics from api gateway and stores them. Runs on http://localhost:9090
Grafana is dashboarding UI, shows the metrics Runs on http://localhost:3333
Runs on http://localhost:15672
A simple implementation of a JWT rovoker using the KrakenD remote bloomfilter client.
Runs on http://localhost:9000
Just:
docker-compose up
Transalte your KrakenD config file into a dot graph
go get github.com/devopsfaith/krakend-config2dot/cmd/krakend-config2dot
krakend-config2dot -c api-gw/krakend.json |dot -Tpng -o config.png
go get -u github.com/devopsfaith/krakend-postman
Fire up your browser, curl, postman, httpie or anything else you like to interact with any of the published services.
To add or remove endpoints, edit the file api-gw/krakend.json
. The easiest way to do it is by dragging this file to the KrakenD designer and download the edited file.
To reflect the changes restart docker-compose.
The following endpoints are worth noticing:
/private/auth0
: Protects and endpoint validating JWT tokens issued by Auth0/private/custom
: Protects and endpoint validating custom JWT tokens signed with/token
./token
: Signs a token/public
: Simple aggregation of two public API calls from Bitbucket and Github with some field selection./splash
: Public endpoint aggregating data from the internal backend
k6 run loadtest/test.js