api
: A basic REST gateway, forwarding requests onto service(s).racing
: A very bare-bones racing service.
sports-betting/
├─ api/
│ ├─ proto/
│ ├─ main.go
├─ racing/
│ ├─ db/
│ ├─ proto/
│ ├─ service/
│ ├─ main.go
├─ sports/
│ ├─ db/
│ ├─ proto/
│ ├─ service/
│ ├─ main.go
├─ README.md
- Install Go (latest).
brew install go
... or see here.
- Install
protoc
brew install protobuf
... or see here.
- In a terminal window, start our racing service...
cd ./racing
go build && ./racing
➜ INFO[0000] gRPC server listening on: localhost:9000
- In another terminal window, start our api service...
cd ./api
go build && ./api
➜ INFO[0000] API server listening on: localhost:8000
- Make a request for races...
curl -X "POST" "http://localhost:8000/v1/listevents" \
-H 'Content-Type: application/json' \
-d $'{
"filter": {}
}'