package main import ( "net/http" ) func indexMux(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": indexGet(w, r) default: http.Error(w, "Bad Request", 400) } } func recipeMux(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": recipeGet(w, r) default: http.Error(w, "Bad Request", 400) } } func recipeEditMux(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": recipeEditGet(w, r) case "POST": recipeEditPost(w, r) default: http.Error(w, "Bad Request", 400) } } func recipeConfirmDeletionMux(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": recipeConfirmDeletionGet(w, r) case "POST": recipeConfirmDeletionPost(w, r) default: http.Error(w, "Bad Request", 400) } } func addRecipesMux(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": addRecipesGet(w, r) default: http.Error(w, "Bad Request", 400) } } func staticStyleMux(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": staticGet(w, r, "style.css") default: http.Error(w, "Bad Request", 400) } } func faviconMux(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": staticGet(w, r, "favicon.ico") default: http.Error(w, "Bad Request", 400) } }