feat(gallery): routes

This commit is contained in:
2026-05-31 10:46:07 +02:00
parent ee3eba3cd9
commit 9282f1f634
22 changed files with 223 additions and 34 deletions
@@ -0,0 +1,18 @@
package restgallery
import (
"log/slog"
"net/http"
"git.schreifuchs.ch/schreifuchs/schreifuchs.ch/web/pages"
)
func (h *Handler) gallery(w http.ResponseWriter, r *http.Request) {
imgs, err := h.srv.GetImages(r.Context())
if err != nil {
slog.Error("could not get images", "err", err)
w.WriteHeader(http.StatusInternalServerError)
return
}
h.r.Render(r.Context(), w, r, pages.Gallery(imgs))
}