Skip to content

Latest commit

 

History

History
34 lines (30 loc) · 938 Bytes

README.md

File metadata and controls

34 lines (30 loc) · 938 Bytes

hello-go

Simple json and grpc web server written in go with gorilla/mux

This is not intended to be used in any meaningful way other than to test in simple local and container runtimes.

Usage

If building from scratch always run make generate before hand.

Docker

docker image build -t hello-go .
docker container run --rm -d -p 8080:8080 -p 9090:9090 --name hello-go hello-go
curl localhost:8080/
# {"ip":"192.168.65.1:61407","message":"Hello From Go!"}
grpcurl -plaintext localhost:9090 main.Hello/SayHello
# {
#   "ip": "192.168.65.1:58783",
#   "message": "Hello From Go!"
# }

Locally

go run .
# json http server listening at [::]:8080
# gRPC server listening at [::]:9090
curl localhost:8080/
# {"ip":"[::1]:53963","message":"Hello From Go!"}
grpcurl -plaintext localhost:9090 main.Hello/SayHello
# {
#   "ip": "[::1]:53973",
#   "message": "Hello From Go!"
# }