A super simple webserver, written in go.
Based on: https://marcofranssen.nl/go-webserver-with-graceful-shutdown/
The simples way to compile this application is to use the provide makefile. It provides cross compilation to linux and windows and makes use of docker.
Docker:
make build-windows
make build-linux
Manual and without docker:
go build -o ./out/ ./cmd/mapprovider/
Start server:
./webserver -listen-addr=:80 -base-path=foo
Application can be configure using command line arguments or environment variables or a combination of both.
- listen-addr/LISTEN_ADDR - listing address, ie. ":5000"
- base-path/BASE_PATH - base path to serve application, ie "/custom"
Example:
./webserver -base-path webserver-0.1.0 -listen-addr :8080
The following endpoints are available, assuming the configuration is not changed.
To run tests:
make test
Please feel free to open a new issue: https://github.com/EricNeid/go-webserver/issues