🦍 The Cloud-Native API Gateway
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
Kong is a cloud-native, fast, scalable, and distributed Microservice Abstraction Layer (also known as an API Gateway or API Middleware). Made available as an open-source project in 2015, its core values are high performance and extensibility.
Actively maintained, Kong is widely used in production at companies ranging from startups to Global 5000 as well as government organizations.
If you are building for the web, mobile, or IoT (Internet of Things) you will likely end up needing common functionality to run your actual software. Kong can help by acting as a gateway (or a sidecar) for microservices requests while providing load balancing, logging, authentication, rate-limiting, transformations, and more through plugins.
Kong has been built with the following leading principles:
For more info about plugins and integrations, you can check out the Kong Hub.
Kong comes in many shapes. While this repository contains its core's source code, other repos are also under active development:
You can find every supported distribution at the official installation page.
If you are planning on developing on Kong, you'll need a development installation. The
branch holds the latest unreleased source code.
You can use Docker / docker-compose and a mounted volume to develop Kong by following the instructions on Kong/kong-build-tools.
You can use a Vagrant box running Kong and Postgres that you can find atKong/kong-vagrant.
Kong mostly is an OpenResty application made of Lua source files, but also requires some additional third-party dependencies. We recommend installing those by following the source install instructions at https://docs.konghq.com/install/source/.
Instead of following the second step (Install Kong), clone this repository and install the latest Lua sources instead of the currently released ones:
$ git clone https://github.com/Kong/kong $ cd kong/ # you might want to switch to the development branch. See CONTRIBUTING.md $ git checkout next # install the Lua sources $ luarocks make
Check out the development sectionof the default configuration file for properties to tweak in order to ease the development process for Kong.
Modifying the [
](https://github.com/openresty/lua-nginx-module#lua_package_cpath)directives will allow Kong to find your custom plugin's source code wherever it might be in your system.
$ make dev
Kong relies on three test suites using the busted testing library:
The first can simply be run after installing busted and running:
$ make test
However, the integration and plugins tests will spawn a Kong instance and perform their tests against it. As so, consult/edit the
configuration file to make your test instance point to your Postgres/Cassandra servers, depending on your needs.
You can run the integration tests (assuming both Postgres and Cassandra are running and configured according to
$ make test-integration
And the plugins tests with:
$ make test-plugins
Finally, all suites can be run at once by simply using:
$ make test-all
Consult the run_tests.sh script for a more advanced example usage of the tests suites and the Makefile.
Finally, a very useful tool in Lua development (as with many other dynamic languages) is performing static linting of your code. You can use luacheck(installed with
) for this:
$ make lint
When developing, you can use the
for doing the following operations:
| Name | Description | | ------------------:| -------------------------------------------------------| |
| Install the Kong luarock globally | |
| Install development dependencies | |
| Lint Lua files in
| Run the unit tests suite | |
| Run the integration tests suite | |
| Run the plugins test suite | |
| Run all unit + integration + plugins tests at once |
If you are working in a large organization you should learn more about Kong Enterprise.
Copyright 2016-2020 Kong Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.