From ae1a31f226de5701683231afaabf0f66503ca17d Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 8 Jan 2024 19:36:01 +0100 Subject: Implement recipe editing --- main.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index e7acac1..a546d86 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,7 @@ import ( "os/signal" "syscall" + "xengineering.eu/ceres/controller" "xengineering.eu/ceres/model" "xengineering.eu/ceres/view" @@ -45,6 +46,8 @@ func startServer(addr string) *http.Server { Handler(http.StripPrefix("/static/", http.FileServer(http.FS(static)))) r.HandleFunc("/recipes/{id}", view.HandlerHTML(&model.Recipe{})).Methods(`GET`) + r.HandleFunc("/recipes/{id}/edit", view.RecipeEditHandler).Methods(`GET`) + r.HandleFunc("/recipes/{id}", controller.RecipePost).Methods(`POST`) r.HandleFunc("/", view.HandlerHTML(&model.Index{})).Methods(`GET`) -- cgit v1.2.3-70-g09d2