Kong is a scalable and customizable API Management Layer built on top of nginx.
See INSTALL.md for installation instructions on your platform.
A complete documentation can be found at: getkong.org/docs
Use Kong through the bin/kong
executable. Make sure your Cassandra instance is running.
The first time ever you're running Kong, you need to make sure to setup Cassandra by executing:
bin/kong migrate
To start Kong:
bin/kong start
See all the available options, with bin/kong -h
.
Running Kong for development requires you to run:
make dev
This will install development dependencies and create your environment configuration files (kong_TESTS.yml
and kong_DEVELOPMENT.yml
).
- Run the tests:
make test-all
- Run it:
bin/kong -c kong.yml start
When developing, use the Makefile
for doing the following operations:
Name | Description |
---|---|
install |
Install the Kong luarock globally |
dev |
Setup your development environment |
run |
Run the DEVELOPMENT environment (kong_DEVELOPMENT.yml ) |
seed |
Seed the DEVELOPMENT environment (kong_DEVELOPMENT.yml ) |
drop |
Drop the DEVELOPMENT environment (kong_DEVELOPMENT.yml ) |
lint |
Lint Lua files in src/ |
coverage |
Run unit tests + coverage report (only unit-tested modules) |
test |
Run the unit tests |
test-proxy |
Run the proxy integration tests |
test-server |
Run the server integration tests |
test-api |
Run the api integration tests |
test-all |
Run all unit + integration tests at once |
Those scripts provide handy features while developing Kong:
This script handles schema migrations, seeding and dropping of the database.
# Complete usage
scripts/db.lua --help
# Migrate up
scripts/db.lua [-c configuration_file] migrate # for all commands, the default configuration_file is kong.yml
# Revert latest migration
scripts/db.lua rollback
# Revert all migrations (danger! this will delete your data)
scripts/db.lua reset
# Seed DB (danger! this will delete your data)
scripts/db.lua seed
# Drop DB (danger! this will delete your data)
scripts/db.lua drop
This script handles Kong's configuration files. It is better not to directly use it, as it is mainly used through bin/kong
and the Makefile.