https://github.com/sleleko/go-microservice
Simple microservice example based on Golang
https://github.com/sleleko/go-microservice
Last synced: 5 months ago
JSON representation
Simple microservice example based on Golang
- Host: GitHub
- URL: https://github.com/sleleko/go-microservice
- Owner: sleleko
- Created: 2023-08-09T20:37:13.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-09T21:45:32.000Z (almost 3 years ago)
- Last Synced: 2025-12-18T10:41:26.159Z (7 months ago)
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-microservice
Simple microservice example based on Golang
## How to run?
1) First you should install Go into your operation system
2) run service 1 ```go run service1.go```
3) run service 2 ```go run service2.go```
4) run gateway ```go run gateway.go```
## How to test result ?
1) Run (for example via curl or your browser) http://localhost:8080/service1 (You should see message from service1 called via microservice gateway)
2) Run (for example via curl or your browser) http://localhost:8080/service2 (You should see message from service2 called via microservice gateway)
3) Run (for example via curl or your browser) http://localhost:8081/ (You should see message from service1 called via service1 directly)
4) Run (for example via curl or your browser) http://localhost:8082/ (You should see message from service1 called via service2 directly)
## How to run in Docker ?
1) git clone this project
2) For start: go to project dir and run ```docker-compose up --build```
3) For stop: ```docker-compose down```