A simple http service that displays hello world whether you send an http GET, POST, PUT, etc. and no matter the url requested.
GoMIT
hello
A simple http server, written in go.
Requests can be sent using GET, POST, PUT, et. al.
Requests can be sent to ANY URL.
This service will always return the json string: { "hello": "world" }
Why?
There are MANY very similar services available to be run from docker containers.
When I was pulling one of them, I was stunned how large the container was and that only a few urls were supported.
This little hello container is not meant to impress, but to be small, quick to pull, easy to use, and serve well when a test web service is needed.
HTTP Service Port
The default port is 8765
The http service port can be overwritten by setting the HTTP_PORT environment variable
HTTP_PORT=8765
Build
Application
Ensure golang is installed
Run build.sh
build.sh will produce binaries in the target directory which can be run on multiple platforms.
./build.sh
Building darwin-amd64
Building linux-amd64
Building windows-amd64
tree target
target
├── hello-darwin-amd64
├── hello-linux-amd64
└── hello-windows-amd64.exe
Docker Image
Ensure docker is installed
The build_docker.sh script will build the docker image.
Build the docker image after building the application.
To push to the Docker Registry, set the PUSH_TO_REGISTRY environment variable to true.