Hi all, managing web APIs has always been a problem. There are quite a few advanced API Management services, such as MS Azure, AWS, CA-like capabilities, but you have to pay a certain fee to use these tools. You can manage your web APIs for free with these tools: kong, tyk, etc. These tools can be used as an alternative solution.

In this article, I will tell you how to manage web API with kong.

  • Operating System: CentOS 7.3
  • DB Server: PostgreSQL 9.6

You can download KONg from this address: https://getkong.org/install/centos

Run below commands on CentOS.

Kong supports Cassandra and PostgreSQL 9.4+ as DB.
We need to create DB for Kong:

After creating the DB, we write the access information into kong.conf.

We can now run the application.

For access: curl http://kong-ip-address:8001

Once the kong setup is finished, you can use the kong-dashboard to manage your web APIs over the web.

For kong-dashboard setup: https://github.com/PGBI/kong-dashboard

Requirements: nodejs & npm

Go to http://kong-ip-address:8080/#/config config in your web browser.

kong

Now that you are ready to manage your API with Kong, we add APIs from the APIs tab.

You can now call your API via Kong. http://kong-ipaddress:port/api/path

You can add a basic authentication without modifying the code for your API, which you started to manage over Kong.

From the Consumer tab, we add a record for testing and enable the basic authentication plugin in the plugin tab.

The API you are calling from http://kong-ipaddress:port/api/path  will now need to be accessed with user/password. You can access it with the user/password you have added to Consumer.

Thanks.
-Ahmet Fikri Ay