From 0a40e8487cb9e1ce4c21fbd6ba84ea5044a0db45 Mon Sep 17 00:00:00 2001 From: maride Date: Wed, 22 Aug 2018 20:38:57 +0200 Subject: Generate config file and host it on a local port --- host.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 host.go (limited to 'host.go') 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 -- cgit 1.4.1