Home API (Feature 21) (#173)
CI / ci (push) Successful in 8m4s

Co-authored-by: orchestrator-agent <20+orchestrator-agent@code.cubecraftcreations.com>
This commit was merged in pull request #173.
This commit is contained in:
2026-10-09 20:52:29 -04:00
committed by approver_agent
parent 4dcfc3c27d
commit dbb6310112
27 changed files with 849 additions and 31 deletions
+22
View File
@@ -0,0 +1,22 @@
package server
import (
"log/slog"
"net/http"
"code.cubecraftlabs.com/Maniacs_Mansion/Meal-Quest/internal/home"
)
// getHome answers GET /home with the Home screen at the household's local
// "now".
func getHome(logger *slog.Logger, svc *home.Service) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
h, err := svc.Get(r.Context())
if err != nil {
logger.ErrorContext(r.Context(), "read home", "error", err)
writeError(w, r, logger, http.StatusInternalServerError, "internal", "internal error")
return
}
writeJSON(w, r, logger, http.StatusOK, h)
}
}