summaryrefslogtreecommitdiff
path: root/livewatch.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-03-25 20:00:38 +0100
committerDimitri Sokolyuk <demon@dim13.org>2015-03-25 20:00:38 +0100
commitec277ab95f2147017a55816f533cdb2ee3f811ed (patch)
tree9998043c13d873b480bf5410146fad8aa0235d33 /livewatch.go
Initial import
Diffstat (limited to 'livewatch.go')
-rw-r--r--livewatch.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/livewatch.go b/livewatch.go
new file mode 100644
index 0000000..7a6c02c
--- /dev/null
+++ b/livewatch.go
@@ -0,0 +1,18 @@
+package main
+
+import (
+ "io"
+ "net/http"
+)
+
+func init() {
+ http.HandleFunc("/livewatch", liveWatch)
+}
+
+func liveWatch(w http.ResponseWriter, r *http.Request) {
+ key := r.FormValue("key")
+ if len(key) != 32 {
+ key = "Ok"
+ }
+ io.WriteString(w, key)
+}