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

25 lines
469 B
Go
Raw Normal View History

2017-05-26 13:35:26 +00:00
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) {
2017-05-26 13:45:45 +00:00
templ, err := template.ParseFiles("template/Interfaccia.html")
2017-05-26 13:35:26 +00:00
if err != nil {
panic(err.Error())
}
2017-05-26 14:28:38 +00:00
varmap := map[string]interface{}{
"matrice": Matrix,
"tempoAggiorna": Clock,
}
templ.Execute(w, varmap)
2017-05-26 13:35:26 +00:00
}