From 16dc72f1bfeb4e4f0701e3bf1fc2357af8a8e64e Mon Sep 17 00:00:00 2001 From: Lomanic Date: Sun, 4 Oct 2020 21:19:42 +0200 Subject: [PATCH] Inital go version --- README.md | 4 ++++ main.go | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 README.md create mode 100644 main.go diff --git a/README.md b/README.md new file mode 100644 index 0000000..b2cfa0c --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +Presence button +=============== + +See https://wiki.fuz.re/doku.php?id=projets:fuz:presence_button \ No newline at end of file diff --git a/main.go b/main.go new file mode 100644 index 0000000..676d5a7 --- /dev/null +++ b/main.go @@ -0,0 +1,16 @@ +package main + +import ( + "fmt" + "log" + "net/http" +) + +func handler(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:]) +} + +func main() { + http.HandleFunc("/", handler) + log.Fatal(http.ListenAndServe(":8080", nil)) +}