Running federiq serve

federiq serve exposes the engine as an HTTP service.

Endpoints

MethodPathPurpose
GET/healthzLiveness probe — always 200
GET/metricsPrometheus exposition
GET/sourcesList attached source names
POST/queryExecute SQL — {"sql": "..."} → JSON rows

/healthz and /metrics are always reachable. /sources and /query require the bearer token (see auth).

Running it

federiq serve --addr 0.0.0.0:7878 --token "$FEDERIQ_TOKEN" \
  --tls-cert /etc/federiq/cert.pem --tls-key /etc/federiq/key.pem

Without --tls-cert the server listens on plain HTTP and prints a loud warning — don't expose an unencrypted port to the internet.

Making requests

curl -H "authorization: Bearer $FEDERIQ_TOKEN" \
  -H "content-type: application/json" \
  -d '{"sql":"SELECT 1 AS n"}' \
  https://localhost:7878/query

Configuring via env

VariableEffect
FEDERIQ_SERVER_TOKENBearer token for inbound requests
FEDERIQ_LOG_FORMATjson switches tracing to structured logs
FEDERIQ_ROLECaller role for policies
FEDERIQ_REGIONCaller region for policies