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.
1 Answer 1
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.