portfolio/web/handlers/loginpageHandler.go

25 lines
419 B
Go
Raw Normal View History

2024-05-16 17:59:21 +02:00
package handlers
2024-03-21 18:42:00 +01:00
import (
"html/template"
"net/http"
)
2024-05-15 15:27:18 +02:00
func InitLoginpage(w http.ResponseWriter, r *http.Request) {
2024-03-21 18:42:00 +01:00
tmpl := template.Must(template.ParseFiles(
2024-05-15 15:27:18 +02:00
"./templates/login/index.html",
2024-03-21 18:42:00 +01:00
"./templates/navbar/index.html",
"./templates/themeSelector/index.html",
))
err := tmpl.Execute(w, nil)
if err != nil {
_, err := w.Write([]byte("failed to load"))
if err != nil {
return
}
return
}
}