cml04-mediciones/internal/handlers/index.go

21 lines
479 B
Go
Raw Permalink Normal View History

2024-08-20 09:11:15 +02:00
package handlers
import (
"html/template"
"net/http"
"git.espin.casa/albert/cml04-mediciones/internal/client"
"github.com/julienschmidt/httprouter"
)
func IndexHandler(client client.IMediciones) httprouter.Handle {
return func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
t, _ := template.ParseFiles("templates/index.html")
err := t.Execute(w, nil)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
}
}