A little demo for making a business logic (a service) available over GRPC and HTTP.
Uses tiny Gophers for cuteness! \ʕ◔ϖ◔ʔ/
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go get -u google.golang.org/grpc
See https://github.com/google/protobuf/releases
Generate the .proto files, and build the binaries.
make
Start the HTTP interface
BIND=:9000 ./bin/grpcsay_http
Start the GRPC interface
BIND=:50051 ./bin/grpcsay_server
Run the GRPC client
# ADDRESS=localhost:50051 ./bin/grpcsay_client "GRPC is fiiiine"
_________________
< GRPC is fiiiine >
-----------------
\
\
\ʕ◔ϖ◔ʔ/
Hit the HTTP interface
# curl http://localhost:9000/?m=HTTP+is+nice
______________
< HTTP is nice >
--------------
\
\
\ʕ◔ϖ◔ʔ/
The MIT License (MIT)
Copyright (c) 2017 Scott Barr
See LICENSE.md