feat: initial template (Go + Templ + HTMX + CDN Tailwind)
This commit is contained in:
17
internal/web/handler.go
Normal file
17
internal/web/handler.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user