https://github.com/gomatic/gateway
Microservice gateway
https://github.com/gomatic/gateway
gateway grpc microservice
Last synced: 8 months ago
JSON representation
Microservice gateway
- Host: GitHub
- URL: https://github.com/gomatic/gateway
- Owner: gomatic
- License: gpl-3.0
- Created: 2017-01-20T00:02:04.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-06-11T02:00:23.000Z (almost 9 years ago)
- Last Synced: 2025-03-25T07:01:39.397Z (about 1 year ago)
- Topics: gateway, grpc, microservice
- Language: Go
- Size: 32.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# service gateway
[](https://goreportcard.com/report/github.com/gomatic/gateway)
[](https://travis-ci.org/gomatic/gateway)
[](https://godoc.org/github.com/gomatic/gateway)
[](http://www.gnu.org/licenses/gpl-3.0)
## Install
go get github.com/gomatic/gateway
## Test
**Install the example service**
go get github.com/gomatic/service-example
**Run the gateway**
EXAMPLE_SERVICE_PORT=5000 gateway --debug >gateway.log 2>&1 & gateway_pid=$!
**Test the gateway**
curl -s localhost:3000/health # The health check
debug routes
curl -s localhost:2999/header # This debug route generates a JWT token
curl -s localhost:2999/debug/vars # This debug route provides runtime information
**Run the example service**
API_PORT=5000 service-example --debug >service-example.log 2>&1 & service_pid=$!
**Test the example service**
curl -s localhost:5000/health # The health check
curl -s localhost:5000/api/model.json # The OpenAPI documentation
debug routes
curl -s localhost:4999/debug/vars # This debug route provides runtime information
**Call the example service through the gateway**
curl -is -H "$(curl -s localhost:2999/header)" http://localhost:3000/v1/example/health
curl -is -H "$(curl -s localhost:2999/header)" http://localhost:3000/v1/example/api/model.json
### RPC
**Install the example RPC client**
go get github.com/gomatic/service-example/cmd/service-example-client
**Call the example service through the RPC using the client helper**
API_PORT=5000 service-example-client this is a great example message
### Cleanup
kill ${gateway_pid} ${service_pid}
rm gateway.log service-example.log