Initial experiments with Kong
docker-compose up
in one terminal.docker ps
.At this point check if the admin-url of kong is reachable:
curl -i http://localhost:8001/
Now register your local flask app with a unique name: flask-greeter
curl -i -X POST \
--url http://localhost:8001/services/ \
--data 'name=flask-greeter' \
--data 'url=http://0.0.0.0:5000'
Define its unique hostname (flask-greeter.com) and register the route:
curl -i -X POST \
--url http://localhost:8001/services/flask-greeter/routes \
--data 'hosts[]=flask-greeter.com'
Now test the follow routes to see if they are properly redirected:
curl -i -X GET \
--url http://localhost:8000/ \
--header 'Host: flask-greeter.com'
curl -i -X GET \
--url http://localhost:8000/user/MYNAME \
--header 'Host: flask-greeter.com'