Skip to content

The gateway that connected to the microservices using Kong

Notifications You must be signed in to change notification settings

KU-Wongnai/gateway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KU Wongnai - API Gateway

The gateway that connected to the microservices.

Pre-requisite

Install decK CLI

MacOS

If you are on macOS, install decK using brew:

brew tap kong/deck
brew install deck

Windows

if you are on Windows, you can either use the compressed archive from the Github release page or install using CMD by entering the target installation folder and downloading a compressed archive, which contains the binary:

curl -sL https://github.com/kong/deck/releases/download/v1.25.0/deck_1.25.0_windows_amd64.tar.gz -o deck.tar.gz
mkdir deck
tar -xf deck.tar.gz -C deck
powershell -command "[Environment]::SetEnvironmentVariable('Path', [Environment]::GetEnvironmentVariable('Path', 'User') + [IO.Path]::PathSeparator + [System.IO.Directory]::GetCurrentDirectory() + '\deck', 'User')"

Note Please refer to the docs for more informations.

Usage

Start Kong

docker-compose --profile database up -d

Sync Kong configuration to Kong Manager GUI

deck sync

After done with editing or adding services and routes via Kong Manager GUI, run the following command to export the configuration to kong.yaml file.

deck dump

Open http://localhost:8002 and you should see something like this.

kong

Routes

Route Description
http://localhost:8000 Kong Client API
http://localhost:8001 Kong Admin API
http://localhost:8002 Kong Manager GUI

Calling the API

<service-name> is the name of the service that you want to call. e.g. user, restaurant, review, noti, file

<route-path> is the path of the route that you want to call. Same as the path that you defined in the service.

http://localhost:8000/<service-name>/<route-path>

TODOs

  • Add more services and routes
  • Write a documentation
  • Include more routes when other services are ready

Reference

About

The gateway that connected to the microservices using Kong

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published