Configuring a Service
For the purpose of this guide, we’ll create a Service pointing to the Mockbin API. Mockbin is an “echo” type public website which returns the requests it gets back to the requester, as responses. This makes it helpful for learning how Kong proxies your API requests.
Before you can start making requests against the Service, you will need to add a Route to it. Routes specify how (and if) requests are sent to their Services after they reach Kong. A single Service can have many Routes.
After configuring the Service and the Route, you’ll be able to make requests through Kong using them.
You have installed and started Kong Gateway, either through the or a more comprehensive installation.
Issue the following cURL request to add your first Service (pointing to the ) to Kong:
You should receive a response similar to:
Kong is now aware of your Service and ready to proxy requests.
Issue the following cURL request to verify that Kong is properly forwarding requests to your Service. Note that by default Kong handles proxy requests on port :
A successful response means Kong is now forwarding requests made to to the we configured in step #1, and is forwarding the response back to us. Kong knows to do this through the header defined in the above cURL request:
Go to