diff options
author | xengineering <me@xengineering.eu> | 2023-12-27 13:33:59 +0100 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-12-27 13:33:59 +0100 |
commit | c6d2e9dadcd08cdf82aab507d9d4d8d58574df20 (patch) | |
tree | 65495b3fd84060638c5dc396417b6aab926bca79 /main.go | |
parent | 1978c5257e2cf4720716b59c3d69dc21cf457c18 (diff) | |
download | ceres-c6d2e9dadcd08cdf82aab507d9d4d8d58574df20.tar ceres-c6d2e9dadcd08cdf82aab507d9d4d8d58574df20.tar.zst ceres-c6d2e9dadcd08cdf82aab507d9d4d8d58574df20.zip |
Implement index page with recipe overview
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 5 |
1 files changed, 5 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) @@ -41,6 +44,8 @@ func startServer(addr string) *http.Server { r.PathPrefix("/static/"). Handler(http.StripPrefix("/static/", http.FileServer(http.FS(static)))) + r.HandleFunc("/", view.HandlerHTML(&model.Index{})).Methods(`GET`) + muxer := http.NewServeMux() muxer.Handle("/", r) |