mirror of
https://gitlab.durp.info/durfy/apps/durpweb.git
synced 2026-05-07 07:50:31 -05:00
update
This commit is contained in:
parent
035a813154
commit
67b4818274
10 changed files with 181 additions and 33 deletions
25
pkg/index/handler.go
Normal file
25
pkg/index/handler.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
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: "Hello World!!!",
|
||||
MainTitle: "SimpleWebsite!",
|
||||
}
|
||||
|
||||
tmpl.ExecuteTemplate(w, "index.html", data)
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue