watchyourlan/index.go
2022-08-16 23:52:06 +07:00

22 lines
No EOL
439 B
Go

package main
import (
"fmt"
"net/http"
"html/template"
)
var FoundHosts []Host
func index (w http.ResponseWriter, r *http.Request) {
fmt.Println(FoundHosts)
tmpl, _ := template.ParseFiles("templates/index.html", "templates/header.html")
tmpl.ExecuteTemplate(w, "index", FoundHosts)
}
func webgui (hosts []Host) {
// fmt.Println(FoundHosts)
FoundHosts = hosts
http.HandleFunc("/", index)
http.ListenAndServe(":8840", nil)
}