diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -30,15 +30,16 @@ func main() { apiKey = os.Getenv("API_KEY") // setup routes - setupRoutesAPI() - setupRoutesWatch() + mux := http.NewServeMux() + registerRoutesAPI(mux, &APISourceOfficial{}) + registerRoutesWatch(mux) setupHome() - http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) - http.HandleFunc("/", rootHandler) + mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) + mux.HandleFunc("/", rootHandler) // start http server log.Println("Listening on http://localhost:8080") - err := http.ListenAndServe(":8080", nil) + err := http.ListenAndServe(":8080", mux) if err != nil { log.Fatal(err) } |
