Files
powerwatts/AGENTS.md
T
2026-04-20 15:42:34 +02:00

985 B

AGENTS.md

  • Repo root is a single Go module (go.mod), with the app entrypoint in main.go and tests in main_test.go.
  • Static UI files live in static/ and are embedded with //go:embed static/*; changing HTML or SVG requires rebuilding/rerunning tests, not a separate asset pipeline.
  • The server will not start unless WRITE_SECRET is set, or supplied via a local config.json if present.
  • config.json is gitignored; treat it as a local-only runtime override, not a committed config file.
  • ADDR defaults to :8080 when unset.
  • chart_max_watts comes from config.json and only affects the chart when it is greater than zero.
  • The only supported write endpoint is POST /write with X-Secret; requests can be JSON ({"watts":123}) or form-encoded (watts=123).
  • History is kept in memory only, trimmed to the last 12 hours and capped at 10000 points.
  • Use go test ./... from the repo root for verification; targeted tests use go test -run TestName.