20 lines
345 B
Go
20 lines
345 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())
|
|
} else {
|
|
comp = templates.Layout(templates.Index())
|
|
}
|
|
|
|
comp.Render(r.Context(), w)
|
|
}
|