Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the purpose of Kong API Gateway Routes

Tags:

routes

kong

I am trying to better understand Kong API Gateway - Routes

Let's say I add a service to my Kong Admin API. This service only allows GET requests and when you do a GET request to the service, all it does is generate a random number.

I've already POSTed a new service to the admin API. Why do I need routes? I've looked at the documentation but I'm still not understanding the purpose of it.

like image 557
ShadyBears Avatar asked Oct 28 '25 00:10

ShadyBears


1 Answers

In Kong, there are two things service and routes. Take eg. you have created two microservices - A and B which you want to secure behind an API gateway (kong).

So as a step one, you need to register both of them as a service in Kong.

Now in Kong you need to create routes. One or multiple routes can point to a single service. The route is basically a path (or you can say a door).

Say, you created 3 routes L, M, N, such that L points to A, M -> B and N -> A. Now, whenever you hit route (open door) L or N you will be calling service A. When calling M you will be calling service B.

like image 63
Rajat Goel Avatar answered Oct 29 '25 14:10

Rajat Goel