Slide 27
Slide 27 text
Leading in IT Education
.co.il
www.
go ssi - ssi.go
func ssi(url string) template.HTML {
resp, err := http.Get(url)
defer resp.Body.Close()
body, err := ioutil.ReadAll(resp.Body)
return template.HTML(body)
}
func ssiHandler(w http.ResponseWriter, r *http.Request) {
funcMap := template.FuncMap { "ssi": ssi, }
tmpl, err := template.New("root").Funcs(funcMap).ParseGlob("*.html")
err = tmpl.ExecuteTemplate(w, "combiner.html", "")
}