package main
import (
"net/http"
"text/template"
)
const indextpl = `
Challenge Forensic - Administration
{{"{{ box.title }}"}} {{"{{ box.msg }}"}}
`
func Index(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
if indexTmpl, err := template.New("index").Parse(indextpl); err != nil {
http.Error(w, "Cannot create template: "+err.Error(), http.StatusInternalServerError)
} else if err := indexTmpl.Execute(w, nil); err != nil {
http.Error(w, "An error occurs during template execution: "+err.Error(), http.StatusInternalServerError)
}
}