This repository has been archived on 2021-01-15. You can view files and clone it, but cannot push or open issues or pull requests.
goBug/html.go
2017-05-26 17:30:17 +02:00

27 lines
527 B
Go

package main
import (
"html/template"
"net/http"
)
// ServiHTML fa partire il server html
func ServiHTML() {
http.HandleFunc("/", handlerRoot)
http.ListenAndServe(":3000", nil)
}
func handlerRoot(w http.ResponseWriter, r *http.Request) {
templ, err := template.ParseFiles("template/Interfaccia.html")
if err != nil {
panic(err.Error())
}
varmap := map[string]interface{}{
"matrice": Matrix,
"tempoAggiorna": Clock,
"larghezza": Larghezza,
"altezza": Altezza,
}
templ.Execute(w, varmap)
}