Skip to content
/ kong Public
forked from Kong/kong

Kong is a scalable, lightweight and customizable RESTful API Layer

License

Notifications You must be signed in to change notification settings

wpjunior/kong

 
 

Repository files navigation

Kong

Build Status

Kong is a scalable and customizable API Management Layer built on top of nginx.

Requirements

  • Lua 5.1
  • Luarocks 2.2.0
  • OpenResty 1.7.7.2
  • Cassandra 2.1

Installation

From source

[sudo] make install

Usage

Use Kong through the bin/kong executable.

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.

Development

Running Kong for development requires you to run:

make dev

This will create your environment configuration files (dev and tests). Setup your database access for each of these enviroments (be careful about keyspaces, since Kong already uses kong and unit tests already use kong_tests).

  • Run the tests:
make test-all
  • Run it:
bin/kong -c config.dev/kong.yaml -n config.dev/nginx.conf

Makefile

When developing, use the Makefile for doing the following operations:

Name Description
install Install the Kong luarock globally
dev Setup your development enviroment (creates dev and tests configurations)
clean Cleans the development environment
reset Reset your database schema according to the development Kong config inside the dev folder
seed Seed your database according to the development Kong config inside the dev folder
drop Drop your database according to the development Kong config inside the dev folder
test Runs the unit tests
test-proxy Runs the proxy integration tests
test-web Runs the web integration tests
test-all Runs all unit + integration tests at once

Scripts

Those script provide handy features while developing Kong:

Name Commands Description Arguments
migrate
create --conf=[conf] Create a migration file for all available databases in the given conf --name=[name] Name of the migration
migrate --conf=[conf] Migrate the database set in the given conf
rollback --conf=[conf] Rollback to the latest executed migration (TODO)
reset --conf=[conf] Rollback all migrations
seed
seed --conf=[conf] Seed the database configured in the given conf -s (Optional) No output
-r (Optional) Also populate random data (1000 by default)
drop --conf=[conf] Drop the database configured in the given conf -s (Optional) No output

About

Kong is a scalable, lightweight and customizable RESTful API Layer

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Lua 95.4%
  • Shell 1.8%
  • Nginx 1.4%
  • Makefile 1.3%
  • HTML 0.1%