aboutsummaryrefslogtreecommitdiff
path: root/backend/home.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/home.go')
-rw-r--r--backend/home.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/backend/home.go b/backend/home.go
new file mode 100644
index 0000000..8577fec
--- /dev/null
+++ b/backend/home.go
@@ -0,0 +1,18 @@
+package backend
+
+import (
+ "html/template"
+ "net/http"
+
+ "github.com/go-chi/chi/v5"
+)
+
+func HandleHome(r *chi.Mux) {
+ r.Get("/", func(w http.ResponseWriter, r *http.Request) {
+ t := template.Must(template.ParseFS(templates, "templates/home.html", "templates/base.html"))
+ err := t.ExecuteTemplate(w, "base.html", &data{})
+ if err != nil {
+ panic(err)
+ }
+ })
+}