It's years that microservice is a popular solution in distributed computing. People are now considering microservice as a response to a couple of issues in software engineering world. This includes performance, scaling and complexity. Major platforms include a good level of microservice support. This support is divided into few parts. One of this parts is API Gateway. This feature acts a distribution point. Every request is received at the gateway and the gateway distributes it to other microservice nodes based on different criterion.
Many folks have tried their chance on creating an API gateway in their favorite platform. I am no exception as today I created my own API gateway called Valdis. It is based on .Net 5. Valdis is a play on words validation and distribution. As its name implies, it validates the requests and then distributes them to existing microservice nodes. The way it works is not based on redirection, instead, it sends the request to the node internally, receives the answer and then sends it back to the original caller finally.
Navigation is based on the URL. There is a setting which indicates requests should be sent to what hosts. It checks if the URL is starting with a specific string. Hosts can be a list. Which host will be directed to is selected based on a random number. It can be imagined as a load balancing mechanism. See settings a clue:
I'm going to add token validation based on JWT on next step. Also a good logging is desired.