From b19326df6f372f9dd8f218d0c5b4d2d8b4d4fc35 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 3 Mar 2024 15:13:55 +0100 Subject: view: Add 'Read' suffix to function names This reflects that these HTTP handler functions implement one of the four CRUD methods create, read update and delete. --- main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index aa04065..ec061c2 100644 --- a/main.go +++ b/main.go @@ -45,15 +45,15 @@ func startServer(addr string) *http.Server { r.PathPrefix("/static/"). Handler(http.StripPrefix("/static/", http.FileServer(http.FS(static)))) - r.HandleFunc("/recipes", view.Recipes).Methods(`GET`) + r.HandleFunc("/recipes", view.RecipesRead).Methods(`GET`) - r.HandleFunc("/recipe/{id:[0-9]+}", view.Recipe).Methods(`GET`) + r.HandleFunc("/recipe/{id:[0-9]+}", view.RecipeRead).Methods(`GET`) r.HandleFunc("/recipe", controller.RecipeUpdate).Methods(`POST`) r.HandleFunc("/recipe/{id:[0-9]+}", controller.RecipeDelete).Methods(`DELETE`) - r.HandleFunc("/favicon.ico", view.Favicon).Methods(`GET`) + r.HandleFunc("/favicon.ico", view.FaviconRead).Methods(`GET`) - r.HandleFunc("/", view.Index).Methods(`GET`) + r.HandleFunc("/", view.IndexRead).Methods(`GET`) muxer := http.NewServeMux() muxer.Handle("/", r) -- cgit v1.2.3-70-g09d2