package controller import ( infini "infini/functions" "net/http" "text/template" ) func MainPage(w http.ResponseWriter, r *http.Request) { if r.URL.Path != "/" { // met l'url de la page infini.NotFound(w, r) // si l'url n'est pas bonne, renvoie sur la page d'erreur 404 return } tmpl, err := template.ParseFiles("html/index.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) } }