This API gateway uses Nginex to handle authentication and route requests to backend services. When a user makes a request, the gateway authenticates the user and, upon successful authentication, forwards the request to the appropriate service. This setup centralizes authentication and simplifies service management.
cd docker
docker-compose up --build -d
curl --location 'http://localhost:8080/auth/register' \
--header 'Content-Type: application/json' \
--data '{
"username": "sakib",
"password": "122"
}'
curl --location 'http://localhost:8080/auth/login' \
--header 'Content-Type: application/json' \
--data '{
"username": "sakib",
"password": "122"
}'
- Response:
{ "token": "your-jwt-token" }
curl --location --request GET 'http://localhost:8080/product/products' \
--header 'Authorization: Bearer your-token' \
--header 'Content-Type: application/json'
docker-compose down
Kong Implementation: https://github.com/sakibhasancse/ApiGatway/tree/kong-implementation