You are browsing documentation for an outdated version of Kong. Go here
to browse the documentation for the latest version.
Table of Contents
In this section, you’ll be adding your API to the Kong layer. This is the first step to having Kong manage your API. Kong exposes a RESTful API for managing the details of your Kong instances.
1. Add your API using the RESTful API
Issue the following cURL request to add your first API ([Mockbin][mockbin]) to Kong:
$ curl -i -X POST \
--url http://localhost:8001/apis/ \
--data 'name=mockbin' \
--data 'target_url=http://mockbin.com/' \
**Note:** Kong handles API configuration requests on port `:8001`
2. Verify that your API has been added
You should see a similar response from the initial request:
HTTP/1.1 201 Created
Kong is now aware of your API and ready to proxy requests.
3. Forward your requests through Kong
Issue the following cURL request to verify that Kong is properly forwarding requests to your API:
$ curl -i -X GET \
--url http://localhost:8000/ \
--header 'Host: mockbin.com'
A successful response means Kong is now forwarding requests to the `target_url` we passed in the first step and giving us the response back. Kong knows to do this through the header defined in the above cURL request:
**Note:** Kong handles proxy requests on port `:8000`
Now that you’ve got your API added to Kong lets learn how to enable plugins.
Go to Enabling Plugins ›