package main import ( "log" "net/http" ) func setupRoutes(db *Database) { http.HandleFunc("/", indexMux(db)) http.HandleFunc("/recipe", recipeMux(db)) http.HandleFunc("/recipe/edit", recipeEditMux(db)) http.HandleFunc("/recipe/image", recipeImageMux()) http.HandleFunc("/add_recipes", addRecipesMux(db)) http.HandleFunc("/static/style.css", staticStyleMux()) http.HandleFunc("/favicon.ico", faviconMux()) } func runServer(db *Database) { setupRoutes(db) address := config.Http.Host + ":" + config.Http.Port log.Println("Binding to 'http://" + address) log.Fatal(http.ListenAndServe(address, nil)) }