From e105822a4f2227ca97853ac1bf106f8d204d6837 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 17 Feb 2024 17:51:00 +0100 Subject: controller: Update recipe based on JSON --- main.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index ec811c9..2b18ade 100644 --- a/main.go +++ b/main.go @@ -11,6 +11,7 @@ import ( "xengineering.eu/ceres/model" "xengineering.eu/ceres/view" + "xengineering.eu/ceres/controller" "github.com/gorilla/mux" ) @@ -45,6 +46,7 @@ func startServer(addr string) *http.Server { Handler(http.StripPrefix("/static/", http.FileServer(http.FS(static)))) r.HandleFunc("/recipes", view.Recipes).Methods(`GET`) r.HandleFunc("/recipe/{id:[0-9]+}", view.Recipe).Methods(`GET`) + r.HandleFunc("/recipe", controller.Recipe).Methods(`POST`) r.HandleFunc("/favicon.ico", view.Favicon).Methods(`GET`) r.HandleFunc("/", view.Index).Methods(`GET`) -- cgit v1.2.3-70-g09d2