Refactor for readability
This commit is contained in:
1 parent
ff9860023b
commit
17baba1490
11 files changed
+536
-405
No files matched your search
@@ -0,0 +1,11 @@
|
||||
# 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`.
|
||||
Reference in new issue
Block a user