diff options
Diffstat (limited to 'view/recipes.go')
| -rw-r--r-- | view/recipes.go | 23 | 
1 files changed, 23 insertions, 0 deletions
diff --git a/view/recipes.go b/view/recipes.go new file mode 100644 index 0000000..3a5fbf8 --- /dev/null +++ b/view/recipes.go @@ -0,0 +1,23 @@ +package view + +import ( +	"net/http" + +	"xengineering.eu/ceres/model" +) + +func Recipes(w http.ResponseWriter, r *http.Request) { +	recipes := make(model.Recipes, 0) + +	err := recipes.Read() +	if err != nil { +		http.Error(w, err.Error(), http.StatusInternalServerError) +		return +	} + +	err = html.ExecuteTemplate(w, "recipes", recipes) +	if err != nil { +		http.Error(w, err.Error(), http.StatusInternalServerError) +		return +	} +}  | 
