Skip to content

Latest commit

 

History

History
75 lines (46 loc) · 1.84 KB

README.md

File metadata and controls

75 lines (46 loc) · 1.84 KB

Fiber Gateway

Golang

The Fiber Gateway is a GoLang-based project designed to serve as a versatile gateway for various API management

Features

  • Load Balancing: Distribute incoming requests evenly across multiple backend services to ensure optimal resource utilization and fault tolerance.

  • Rate Limiting: Protect services from excessive traffic by setting rate limits on incoming requests.

  • API Forwarding: Easily configure and manage the routing of API requests from clients to the appropriate backend services.

Getting Started

Prerequisites

Before you can run the Fiber Gateway, ensure you have the following prerequisites installed:

  • Go: Make sure you have Go installed on your system.

Installation

  1. Clone the repository to your local machine:
git clone [email protected]:khiem20tc/go-fiber-gorm-boilerplate.git
  1. Create a .env file and define the necessary environment variables. These variables will be used for configuration. Example:
DATABASE_URL="localhost:5432"
  1. Download and install packages
go mod download && go mod tidy
  1. Run the Fiber Gateway using the following command:
go run main.go

or

nodemon --watch './**/*.go' --signal SIGTERM --exec 'go' run ./main.go
  1. Run Lint-stage for Golang
golangci-lint run
  1. Gen swagger API document using the following command:
go run ./scripts/gen-swagger/main.go && go run ./scripts/swag/main.go init --ot go,json --parseDependency true
  1. Build docker container
docker-compose up -d --force-recreate

Usage

Once the Fiber Gateway is up and running, you can start sending API requests to it, and it will handle load balancing, rate limiting, and forwarding based on the configuration.