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 111cd2daab
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 47s
#73 copy sign in form from other branch and some renaming
2024-08-25 22:25:32 +02:00

21 lines
377 B
Go

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)
}