feat(server): /healthz returns min_client_version

Lets the M7 Flutter client refuse to operate against an incompatible
server (e.g., new endpoints the client depends on, breaking schema
shifts). The version constant is bumped on each release where the
client/server contract changes; old clients show the user a blocking
"update required" modal pointed at the latest APK / TestFlight build.
This commit is contained in:
2026-05-02 15:11:10 -04:00
parent c3be0f3e6e
commit b03da903d9
3 changed files with 37 additions and 1 deletions
+4 -1
View File
@@ -103,7 +103,10 @@ func (s *Server) Router() http.Handler {
func (s *Server) handleHealthz(w http.ResponseWriter, _ *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
_ = json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
_ = json.NewEncoder(w).Encode(map[string]string{
"status": "ok",
"min_client_version": MinClientVersion,
})
}
// handleAdminScan runs a scan synchronously and returns the resulting stats.