package controller import ( hub "hub/functions" "net/http" "text/template" ) func TestPage(w http.ResponseWriter, r *http.Request) { if r.URL.Path != "/test" { // met l'url de la page hub.NotFound(w, r) // si l'url n'est pas bonne, renvoie sur la page d'erreur 404 return } tmpl, err := template.ParseFiles("html/test.html") if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) return } err = tmpl.Execute(w, nil) if err != nil { http.Error(w, err.Error(), http.StatusInternalServerError) } }