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/image", image(config.Storage)) http.HandleFunc("/add_recipes", add_recipes(db, config.Storage, config.Static)) http.HandleFunc("/static/libweb.css", static("libweb.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)) }