From f9a5140071703faf0c7515a05f52e69fdc1f11ba Mon Sep 17 00:00:00 2001 From: xengineering Date: Wed, 8 Feb 2023 20:53:20 +0100 Subject: Move all sources to package main This project is not so big that it needs multiple packages. --- web/router.go | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 web/router.go (limited to 'web/router.go') diff --git a/web/router.go b/web/router.go deleted file mode 100644 index ec67399..0000000 --- a/web/router.go +++ /dev/null @@ -1,29 +0,0 @@ - -package web - -import ( - "log" - "net/http" - - "xengineering.eu/ceres/utils" -) - -func RunServer(config utils.HttpConfig, db *utils.Database) { - - http.HandleFunc("/", index(db, config.Templates)) - - http.HandleFunc("/recipe", recipe(db, config.Templates)) - - http.HandleFunc("/recipe/edit", recipe_edit(db, config.Templates)) - - http.HandleFunc("/recipe/image", image(config.Storage)) - - http.HandleFunc("/add_recipes", add_recipes(db, config.Storage, config.Static)) - - http.HandleFunc("/static/style.css", static("style.css", config.Static)) - http.HandleFunc("/favicon.ico", static("favicon.ico", config.Static)) - - address := config.Host + ":" + config.Port - log.Println("Binding to 'http://" + address) - log.Fatal(http.ListenAndServe(address, nil)) -} -- cgit v1.2.3-70-g09d2