Render default route on "/"

This commit is contained in:
Achim Rohn
2025-08-13 11:36:30 +02:00
parent 414c05f711
commit 7cf7cb52c9
+5
View File
@@ -89,6 +89,7 @@ type HtmxRoute interface {
GetHtmx(language Language, queryParams ...HtmxPathParam) gomponents.Node GetHtmx(language Language, queryParams ...HtmxPathParam) gomponents.Node
SetActivePath(activePath *ActivePath) HtmxRoute SetActivePath(activePath *ActivePath) HtmxRoute
Add(server *http.ServeMux) Add(server *http.ServeMux)
Execute(c HtmxContext)
} }
func addLanguageToPath(path string, language Language) string { func addLanguageToPath(path string, language Language) string {
@@ -102,6 +103,10 @@ type HtmxGetRoute struct {
ActivePath *ActivePath ActivePath *ActivePath
} }
func (h HtmxGetRoute) Execute(c HtmxContext) {
h.RouteFunc(c)
}
func (h HtmxGetRoute) SetActivePath(activePath *ActivePath) HtmxRoute { func (h HtmxGetRoute) SetActivePath(activePath *ActivePath) HtmxRoute {
h.ActivePath = activePath h.ActivePath = activePath
return h return h