aboutsummaryrefslogtreecommitdiff
path: root/backend/home.go
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 17:21:21 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2025-10-02 17:21:21 +0200
commita471baf6ee1b1a05acec23f2de1b74f56f4596a5 (patch)
tree40012fd384e01c8365554daca6ccdf6c76bb8d9a /backend/home.go
parent5bfd611e7b3468ae38263388e2415d4bba94b0fc (diff)
feat(backend): handle home
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)
+ }
+ })
+}