Files
template-go-web/internal/web/handler.go
Mathias Bergqvist a25120cd1d
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
feat: initial template (Go + Templ + HTMX + CDN Tailwind)
2026-05-05 08:19:04 +02:00

18 lines
374 B
Go

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
}