Static files handler
This commit is contained in:
@@ -103,8 +103,6 @@ func main() {
|
|||||||
} else {
|
} else {
|
||||||
http.HandleFunc("/noolite/", func(w http.ResponseWriter, r *http.Request) {
|
http.HandleFunc("/noolite/", func(w http.ResponseWriter, r *http.Request) {
|
||||||
command, channel, value, red, green, blue := parseParams(r.URL.Path[1:])
|
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)
|
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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user