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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user