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.
| Route | Who | What |
|---|---|---|
POST /fleet/heartbeat | the fleet's secret | A game server's heartbeat (FleetHeartbeat): 204; 400 for what is no heartbeat, 403 for addresses that are not the fleet's. |
GET /fleet | the fleet's secret | The servers heard from lately, with their players, rooms and versions. |
GET /fleet/targets?kind=game|node | the private network | Prometheus's http_sd: every game process's /metrics, or every host's node-exporter. |