summaryrefslogtreecommitdiff
path: root/router.go
diff options
context:
space:
mode:
Diffstat (limited to 'router.go')
-rw-r--r--router.go26
1 files changed, 0 insertions, 26 deletions
diff --git a/router.go b/router.go
deleted file mode 100644
index ef7397d..0000000
--- a/router.go
+++ /dev/null
@@ -1,26 +0,0 @@
-
-package main
-
-import (
- "log"
- "net/http"
-)
-
-func setupRoutes(config HttpConfig, db *Database) {
-
- http.HandleFunc("/", indexMux(db, config.Templates))
- http.HandleFunc("/recipe", recipeMux(db, config.Templates))
- http.HandleFunc("/recipe/edit", recipeEditMux(db, config.Templates))
- http.HandleFunc("/recipe/image", recipeImageMux(config.Storage))
- http.HandleFunc("/add_recipes", addRecipesMux(db, config.Storage, config.Static))
- http.HandleFunc("/static/style.css", staticStyleMux("style.css", config.Static))
- http.HandleFunc("/favicon.ico", faviconMux("favicon.ico", config.Static))
-}
-
-func runServer(config HttpConfig, db *Database) {
-
- setupRoutes(config, db)
- address := config.Host + ":" + config.Port
- log.Println("Binding to 'http://" + address)
- log.Fatal(http.ListenAndServe(address, nil))
-}