Add API Server (Go/PocketBase), Web App (Go BFF + Vue), Fly App (Flutter/DJI MSDK), Adobe Plugin, and Docker/Docker AIO deployment configs. Design assets and build artifacts are gitignored. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
16 lines
476 B
Go
16 lines
476 B
Go
package api
|
|
|
|
import "net/http"
|
|
|
|
// handleHealth reports server readiness plus device counts. "devices" is the
|
|
// number of devices connected right now; "known" also includes offline devices
|
|
// whose last-known state is still cached.
|
|
func (s *Server) handleHealth(w http.ResponseWriter, r *http.Request) {
|
|
writeJSON(w, http.StatusOK, map[string]any{
|
|
"status": "ok",
|
|
"service": "pilotvault-api",
|
|
"devices": s.hub.OnlineCount(),
|
|
"known": len(s.hub.Snapshot()),
|
|
})
|
|
}
|