This project offers a versatile library for constructing an API Gateway using Golang routers. Drawing inspiration from
the Spring Cloud Gateway, the library aims to simplify the
process of managing APIs. Currently, it integrates with Gin, a high-performance HTTP web framework for Golang.
Getting Started
To integrate the Gateway project with your Golang application, follow the steps outlined below:
Installation: Begin by installing the Gateway library.
You can either clone the repository or install it via a package manager like go get.
go get github.com/ViniciusCrisol/gateway
Configuration: To configure your gateway, you just need to set a default error handler, that is used to return
error responses to the end user. After that, connect the gateway to a Gin instance as shown in the following code:
Now, when a user sends a request to localhost:8080/uuid, the Gateway will initiate a reverse proxy
to https://httpbin.org/uuid, allowing the user to interact with the resource located at that endpoint.