diff --git a/html5/karaoke-server.go b/html5/karaoke-server.go index 7164663..c900f12 100644 --- a/html5/karaoke-server.go +++ b/html5/karaoke-server.go @@ -6,12 +6,13 @@ import ( ) func main() { + // 1.) This handler serves the root page html and .js content http.Handle("/", http.FileServer(http.Dir("."))) + // 2.) This handler serves only the karaoke content // To serve a directory on disk (/tmp) under an alternate URL // path (/tmpfiles/), use StripPrefix to modify the request // URL's path before the FileServer sees it: - // This handler serves only the karaoke content http.Handle("/karaoke/", http.StripPrefix("/karaoke/", http.FileServer(http.Dir("./karaoke/")))) log.Fatal(http.ListenAndServe(":8080", nil))