mirror of
https://gitlab.durp.info/durfy/apps/durpweb.git
synced 2026-05-07 16:00:32 -05:00
25 lines
415 B
Go
25 lines
415 B
Go
package index
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
)
|
|
|
|
func GetIndex(w http.ResponseWriter, r *http.Request) {
|
|
|
|
tmpl, err := template.ParseGlob("view/*.html")
|
|
if err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
}
|
|
|
|
data := struct {
|
|
Message string
|
|
MainTitle string
|
|
}{
|
|
Message: "This is a message",
|
|
MainTitle: "SimpleWebsite!",
|
|
}
|
|
|
|
tmpl.ExecuteTemplate(w, "index", data)
|
|
|
|
}
|