diff options
author | maride <maride@darknebu.la> | 2018-08-22 20:38:57 +0200 |
---|---|---|
committer | maride <maride@darknebu.la> | 2018-08-22 20:38:57 +0200 |
commit | 0a40e8487cb9e1ce4c21fbd6ba84ea5044a0db45 (patch) | |
tree | 4074f28479e0398de932ec50d1bff90b9a2b9fa9 /host.go | |
parent | ff1b1fba7a49011088a05c65309f14b5e7b8892e (diff) |
Generate config file and host it on a local port
Diffstat (limited to 'host.go')
-rw-r--r-- | host.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/host.go b/host.go new file mode 100644 index 0000000..9f98607 --- /dev/null +++ b/host.go @@ -0,0 +1,17 @@ +package main + +import ( + "net/http" + "io/ioutil" +) + +func main() { + mux := http.NewServeMux() + mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) { + content, error := ioutil.ReadFile("/tmp/client.conf") + if error == nil { + w.Write(content) + } + }) + http.ListenAndServe(":9999", mux) +} \ No newline at end of file |