package service import ( "me-fit/template" "net/http" "github.com/a-h/templ" ) func HandleIndexAnd404(w http.ResponseWriter, r *http.Request) { var comp templ.Component = nil if r.URL.Path != "/" { comp = template.Layout(template.NotFound()) w.WriteHeader(http.StatusNotFound) } else { comp = template.Layout(template.Index()) } comp.Render(r.Context(), w) }