github.com/10ego/gthp@v0.0.0-20241025155251-e1514fa71fbb/internal/handlers/index-handler.go (about)

     1  package handlers
     2  
     3  import (
     4  	"net/http"
     5  
     6  	"github.com/10ego/gthp/internal/templ/templates"
     7  )
     8  
     9  func (h *Handler) IndexHandler(w http.ResponseWriter, r *http.Request) {
    10  	if r.URL.Path != "/" {
    11  		http.NotFound(w, r)
    12  		return
    13  	}
    14  	templates.Index(h.config.Title).Render(r.Context(), w)
    15  }