diff options
author | xengineering <me@xengineering.eu> | 2024-02-11 22:44:32 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2024-02-13 20:26:42 +0100 |
commit | 40868be7d4b9e1d9909a19dccc25ec49c1b5924b (patch) | |
tree | 97a8923b73c97a4ce92f15ad632cfb65faf06d5c /main.go | |
parent | 43fdfde44bce659abd30186150f667d8ba24cf2b (diff) | |
download | ceres-40868be7d4b9e1d9909a19dccc25ec49c1b5924b.tar ceres-40868be7d4b9e1d9909a19dccc25ec49c1b5924b.tar.zst ceres-40868be7d4b9e1d9909a19dccc25ec49c1b5924b.zip |
view: Implement GET handler for model.Recipes
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -10,6 +10,7 @@ import ( "syscall" "xengineering.eu/ceres/model" + "xengineering.eu/ceres/view" "github.com/gorilla/mux" ) @@ -21,6 +22,8 @@ func main() { model.InitDatabase() defer model.CloseDatabase() + view.Init() + var srv *http.Server = startServer("127.0.0.1:8080") go srv.ListenAndServe() defer stopServer(srv) @@ -40,6 +43,7 @@ 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`) muxer := http.NewServeMux() muxer.Handle("/", r) |