diff options
Diffstat (limited to 'mux.go')
-rw-r--r-- | mux.go | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -5,37 +5,37 @@ import ( "net/http" ) -func indexMux(db *Database) func(http.ResponseWriter, *http.Request) { +func indexMux() func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": - indexGet(w, r, db) + indexGet(w, r) default: http.Error(w, "Bad Request", 400) } } } -func recipeMux(db *Database) func(http.ResponseWriter, *http.Request) { +func recipeMux() func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": - recipeGet(w, r, db) + recipeGet(w, r) case "POST": - recipePost(w, r, db) + recipePost(w, r) default: http.Error(w, "Bad Request", 400) } } } -func recipeEditMux(db *Database) func(http.ResponseWriter, *http.Request) { +func recipeEditMux() func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": - recipeEditGet(w, r, db) + recipeEditGet(w, r) case "POST": - recipeEditPost(w, r, db) + recipeEditPost(w, r) default: http.Error(w, "Bad Request", 400) } @@ -53,13 +53,13 @@ func recipeImageMux() func(http.ResponseWriter, *http.Request) { } } -func addRecipesMux(db *Database) func(http.ResponseWriter, *http.Request) { +func addRecipesMux() func(http.ResponseWriter, *http.Request) { return func(w http.ResponseWriter, r *http.Request) { switch r.Method { case "GET": addRecipesGet(w, r) case "POST": - addRecipesPost(w, r, db) + addRecipesPost(w, r) default: http.Error(w, "Bad Request", 400) } |