Sign inSign up

akgarg0472/urlshortener-api-gateway

By akgarg0472

Updated over 1 year ago

API Gateway for URL Shortener, managing requests and routing to different micro services.

Image
API management
0

3.4K

akgarg0472/urlshortener-api-gateway repository overview

URLShortener API Gateway

This Docker image provides a Spring Boot-based API Gateway for the URL Shortener project. It acts as a reverse proxy, routing requests to various backend services within a microservices architecture, enabling scalable and efficient management of URL shortening and analytics operations.

Key Features:
  • API Gateway Functionality: Routes and load-balances requests to URL Shortener microservices.
  • Easy Customization: Built on Spring Boot, it can be easily configured and extended.
  • Environment Configurable: Modify server settings, logging, and routing via environment variables.
  • Dockerized: Ready to deploy in containerized environments like Docker.
  • Scalable Architecture: Supports flexible routing and backend integration.
Usage:
  1. Pull the Docker Image:

    To begin, pull the Docker image from Docker Hub:

    docker pull akgarg0472/urlshortener-api-gateway:latest
    
  2. Run the Docker Container:

    After pulling the image, you can run the API Gateway in a Docker container using the following command:

     docker run -d \
    -p 8765:8765 \
    -e API_GATEWAY_LOG_PATH=/tmp/logs/apigateway \
    -e API_GATEWAY_LOG_LEVEL=INFO \
    -e API_GATEWAY_LOGGER_REF=consoleLogger \
    -v /host/path/to/logs:/tmp/logs/ \
    --network=host \
    --name api-gateway \
    akgarg0472/urlshortener-api-gateway:latest
    

    This will:

    • Run the container in detached mode (-d).
    • Map port 8765 from the container to the host.
    • Set up logging with environment variables (API_GATEWAY_LOG_PATH, API_GATEWAY_LOG_LEVEL, API_GATEWAY_LOGGER_REF).
    • Bind the host directory for logs using -v.
    • Run the container on the host network (--network=host).
  3. Access the API Gateway:

    Once the container is running, you can access the API Gateway via your browser at:

    http://localhost:8765
    
  4. Configuration Options:

    You can customize the container's behavior by passing environment variables when you run the container. The available options are:

    • API_GATEWAY_LOG_PATH: Specify the path where logs should be stored.

    • API_GATEWAY_LOG_LEVEL: Set the log verbosity level (e.g., INFO, DEBUG).

    • API_GATEWAY_LOGGER_REF: Choose the log output type (consoleLogger or fileLogger).

For more details or customization, you can refer to the GitHub repository.

Tag summary

Content type

Image

Digest

sha256:1282c6bb8

Size

117.2 MB

Last updated

over 1 year ago

docker pull akgarg0472/urlshortener-api-gateway