summaryrefslogtreecommitdiff
path: root/mux.go
diff options
context:
space:
mode:
Diffstat (limited to 'mux.go')
-rw-r--r--mux.go28
1 files changed, 14 insertions, 14 deletions
diff --git a/mux.go b/mux.go
index a351ade..3aed42d 100644
--- a/mux.go
+++ b/mux.go
@@ -5,22 +5,22 @@ import (
"net/http"
)
-func indexMux(db *Database, templateRoot string) func(http.ResponseWriter, *http.Request) {
+func indexMux(db *Database) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
- indexGet(w, r, db, templateRoot)
+ indexGet(w, r, db)
default:
http.Error(w, "Bad Request", 400)
}
}
}
-func recipeMux(db *Database, templateRoot string) func(http.ResponseWriter, *http.Request) {
+func recipeMux(db *Database) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
- recipeGet(w, r, db, templateRoot)
+ recipeGet(w, r, db)
case "POST":
recipePost(w, r, db)
default:
@@ -29,11 +29,11 @@ func recipeMux(db *Database, templateRoot string) func(http.ResponseWriter, *htt
}
}
-func recipeEditMux(db *Database, templateRoot string) func(http.ResponseWriter, *http.Request) {
+func recipeEditMux(db *Database) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
- recipeEditGet(w, r, db, templateRoot)
+ recipeEditGet(w, r, db)
case "POST":
recipeEditPost(w, r, db)
default:
@@ -42,22 +42,22 @@ func recipeEditMux(db *Database, templateRoot string) func(http.ResponseWriter,
}
}
-func recipeImageMux(storage string) func(http.ResponseWriter, *http.Request) {
+func recipeImageMux() func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
- recipeImageGet(w, r, storage)
+ recipeImageGet(w, r)
default:
http.Error(w, "Bad Request", 400)
}
}
}
-func addRecipesMux(db *Database, storage string, static string) func(http.ResponseWriter, *http.Request) {
+func addRecipesMux(db *Database) func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
- addRecipesGet(w, r, static)
+ addRecipesGet(w, r)
case "POST":
addRecipesPost(w, r, db)
default:
@@ -66,22 +66,22 @@ func addRecipesMux(db *Database, storage string, static string) func(http.Respon
}
}
-func staticStyleMux(file string, static string) func(http.ResponseWriter, *http.Request) {
+func staticStyleMux() func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
- staticGet(w, r, file, static)
+ staticGet(w, r, "style.css")
default:
http.Error(w, "Bad Request", 400)
}
}
}
-func faviconMux(file string, static string) func(http.ResponseWriter, *http.Request) {
+func faviconMux() func(http.ResponseWriter, *http.Request) {
return func(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "GET":
- staticGet(w, r, file, static)
+ staticGet(w, r, "favicon.ico")
default:
http.Error(w, "Bad Request", 400)
}