Plan independent BFF and adapt selected Sendico foundations (#34)

This commit is contained in:
Stephan D committed 2026-09-12 13:11:10 +02:00
1 parent 1e191fca42
commit 45666d33fc
17 files changed
+854 -15

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
package httpapi
import (
"encoding/json"
"net/http"
)
// New is the operational shell. Product routes will be added only with their
// persistence, authentication and provider adapters, never simulated success.
func New() http.Handler {
mux := http.NewServeMux()
mux.HandleFunc("GET /healthz", func(w http.ResponseWriter, r *http.Request) {
write(w, http.StatusOK, "ok")
})
mux.HandleFunc("GET /readyz", func(w http.ResponseWriter, r *http.Request) {
write(w, http.StatusServiceUnavailable, "not_configured")
})
return mux
}
func write(w http.ResponseWriter, status int, value string) {
w.Header().Set("Content-Type", "application/json")
w.Header().Set("Cache-Control", "no-store")
w.WriteHeader(status)
_ = json.NewEncoder(w).Encode(struct {
Status string `json:"status"`
}{value})
}