24 lines
410 B
Cheetah
24 lines
410 B
Cheetah
package web
|
|
|
|
import (
|
|
"net/http"
|
|
)
|
|
|
|
type IndexViewData struct {
|
|
Title string
|
|
}
|
|
|
|
func (s *Server) handleIndex(w http.ResponseWriter, r *http.Request) {
|
|
if r.URL.Path != "/" {
|
|
http.NotFound(w, r)
|
|
return
|
|
}
|
|
_ = s.render(w, "base.html", IndexViewData{Title: "Home"})
|
|
}
|
|
|
|
func (s *Server) handleHealthz(w http.ResponseWriter, r *http.Request) {
|
|
w.WriteHeader(http.StatusOK)
|
|
_, _ = w.Write([]byte("ok"))
|
|
}
|
|
|