Skip to content

jonepl-portfolio/api-gateway

Repository files navigation

API Gateway

This repository contains the API Gateway for the hosted applications. The API Gateway is responsible for routing incoming requests to the appropriate microservice.

Design

The API Gateway is designed to accept incoming requests and route them to the appropriate microservice. The gateway uses a reverse proxy to forward requests to the microservices.

Features

Reverse proxy for routing incoming requests to microservices Support for multiple microservices Load balancing and scaling

Prerequisites

  • Docker
  • Docker Swarm

Pre-Merge Checklist

Local Testing

Install bats

$ brew install bats

Running tests

make test

Troubleshooting

Basic Docker Swarm Debugging

Gets container information

$ docker ps

Check the API Gateway Logs

docker service logs api-gateway

Verify the Microservices are Running

docker service ls

Check the Network Configuration

docker network inspect api-gateway-network

View logs of service

docker service logs api-gateway

Debugging Volumes

## ~~~~~~~~ Inspect volume at server level ~~~~~~~~~
$ docker volume inspect {volume-name}

$ ls -R {Mountpoint-from-volume-inspect}

## ~~~~~~~~ Inspect volume at container level ~~~~~~~~~
# Create and ssh into a debugging container
$ docker run --rm -it -v {volume-name}:/container/path busybox sh

# Navigate to the desired container path
$ cd /container/path

# recursively list all directory and see if your contents is within
ls -R