diff options
author | Emile <hanemile@protonmail.com> | 2019-10-06 20:11:44 +0200 |
---|---|---|
committer | Emile <hanemile@protonmail.com> | 2019-10-06 20:11:44 +0200 |
commit | d4dce83782b67236d2c8d99ffc9bdc89328bb5de (patch) | |
tree | e2b9335da1444b264e60ffdfde8c8edf8be0c2e3 /src/http.go | |
parent | 9d8ff5a25d3a5f3c3e2e41de66b05f760bee5bf6 (diff) |
get the status of all other containers
Diffstat (limited to 'src/http.go')
-rw-r--r-- | src/http.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/http.go b/src/http.go new file mode 100644 index 0000000..e29f13e --- /dev/null +++ b/src/http.go @@ -0,0 +1,25 @@ +package main + +import ( + "fmt" + "net/http" + + "github.com/gorilla/mux" +) + +// setupHTTPServer defines a new http server +func setupHTTPServer() http.Server { + r := mux.NewRouter() + + r.HandleFunc("/", indexHandler) + + return http.Server{ + Addr: fmt.Sprintf("0.0.0.0:%d", *port), + Handler: r, + } +} + +// indexHandler handles the "/" endpoint +func indexHandler(w http.ResponseWriter, r *http.Request) { + fmt.Fprintln(w, "This is the index Handler speaking! Prepare to HACK THE PLANET!") +} |