feat: initial template (Go + Templ + HTMX + CDN Tailwind)
Some checks failed
CD / Lint / Test / Vet (push) Failing after 5s
CD / Build & Import (push) Has been skipped
CD / Deploy via GitOps (push) Has been skipped

This commit is contained in:
Mathias Bergqvist
2026-05-05 08:19:04 +02:00
parent 57c1e460b7
commit a25120cd1d
11 changed files with 270 additions and 2 deletions

17
internal/web/handler.go Normal file
View File

@@ -0,0 +1,17 @@
package web
import (
"context"
"net/http"
)
func NewHandler() http.Handler {
mux := http.NewServeMux()
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
_ = Index().Render(context.Background(), w)
})
mux.HandleFunc("/api/hello", func(w http.ResponseWriter, r *http.Request) {
_ = Hello("world").Render(context.Background(), w)
})
return mux
}