Don't use the default mux for handling requests

This commit is contained in:
nemunaire 2016-06-25 16:48:16 +02:00 committed by Pierre-Olivier Mercier
parent fc0834ea4c
commit bde582ad4b
1 changed files with 1 additions and 2 deletions

View File

@ -69,10 +69,9 @@ func main() {
mux.Handle("/teams/", StaticHandler(staticDir))
mux.Handle("/themes/", StaticHandler(staticDir))
mux.Handle("/", http.FileServer(http.Dir(staticDir)))
http.HandleFunc("/", mux.ServeHTTP)
log.Println(fmt.Sprintf("Ready, listening on %s", *bind))
if err := http.ListenAndServe(*bind, nil); err != nil {
if err := http.ListenAndServe(*bind, mux); err != nil {
log.Fatal("Unable to listen and serve: ", err)
}
}