sergsoares / go-simplehttp

Simple golang app to validate data.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple HTTP server written in golang

Simple webserver in golang, to demonstrate basic functionalities like e.g. sending back some request header info, the local IP address of the container and how to include the usage of environment variables.

what does it do?

This container starts a webserver on port 8000 and returns back

  • some header information
  • the local ip address of the container
  • the message provided by environment variable called message

usage

to start simplehttp web server , map local port 8000 into container and provide the env variable message:

sudo docker run -e message=Hello -p 8000:8000 gkoenig/simplehttp

output from above call (your IP address will vary):

GET / HTTP/1.1
Header["User-Agent"] = ["curl/7.58.0"]
Header["Accept"] = ["*/*"]
Host = "localhost:8000"
RemoteAddr = "172.17.0.1:36540"

===> local IP: "172.17.0.2"

Env message = Hello

About

Simple golang app to validate data.


Languages

Language:Go 63.4%Language:Dockerfile 36.6%