Browse Source

Static files handler

Denis V. Dedkov 9 years ago
parent
commit
40aec78068
1 changed files with 3 additions and 3 deletions
  1. 3 3
      noolite-cli.go

+ 3 - 3
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))
 	}
 }