This repository has been archived on 2025-08-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
web-app-template/service/static_ui.go
Tim bba3aee626
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 1m6s
#109 move last url to new layout*A
2024-08-24 19:33:22 +02:00

21 lines
382 B
Go

package service
import (
"me-fit/templates"
"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 = templates.Layout(templates.NotFound())
w.WriteHeader(http.StatusNotFound)
} else {
comp = templates.Layout(templates.Index())
}
comp.Render(r.Context(), w)
}