Skip to content

five-on-it / apps/api/src/fleet-routes

apps/api/src/fleet-routes ​

The fleet's routes (fleet-registry.ts), answered on the API's own port only, never through the stack's proxy: Caddy refuses /api/fleet/…, and a request it forwarded (one that carries X-Forwarded-For) is refused here too. Game servers on the private network post their heartbeats, Prometheus asks for its targets, the fleet's scripts read it.

RouteWhoWhat
POST /fleet/heartbeatthe fleet's secretA game server's heartbeat (FleetHeartbeat): 204; 400 for what is no heartbeat, 403 for addresses that are not the fleet's.
GET /fleetthe fleet's secretThe servers heard from lately, with their players, rooms and versions.
GET /fleet/targets?kind=game|nodethe private networkPrometheus's http_sd: every game process's /metrics, or every host's node-exporter.

Functions ​