From 40aec7806806c3cd8daad8ad5ee84b02d65064f4 Mon Sep 17 00:00:00 2001 From: "Denis V. Dedkov" Date: Fri, 1 Jul 2016 22:37:39 +0500 Subject: [PATCH] Static files handler --- noolite-cli.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/noolite-cli.go b/noolite-cli.go index 89ab941..d783e3c 100644 --- a/noolite-cli.go +++ b/noolite-cli.go @@ -103,8 +103,6 @@ func main() { } else { http.HandleFunc("/noolite/", func(w http.ResponseWriter, r *http.Request) { command, channel, value, red, green, blue := parseParams(r.URL.Path[1:]) - fmt.Fprintf(w, "Command: %q\n", command) - fmt.Fprintf(w, "Channel: %d\n", channel) err := sendCommand(command, channel, value, red, green, blue) @@ -113,6 +111,8 @@ func main() { } }) - panic(http.ListenAndServe(fmt.Sprintf(":%d", *http_port), nil)) + fs := http.FileServer(http.Dir("/var/www/static")) + + panic(http.ListenAndServe(fmt.Sprintf(":%d", *http_port), fs)) } }