Admin Panel for Gateway Stats
This project ships a static frontend in public/ and a Pages Function which exposes the same /api/activity-summary endpoint used by the original server.js.
Steps to deploy on Cloudflare Pages:
- In Pages project settings, set the "Build output directory" (Publish directory) to
public. - Add two environment variables (Secrets) in Pages:
CLOUDFLARE_ACCOUNT_IDandCLOUDFLARE_API_TOKEN. - (Optional) Set
BBSTATS_CACHE_TTL_MSto control how long cached summaries are considered fresh (milliseconds). Default: 6 hours.
The Pages Function lives at functions/api/activity-summary.js. It uses the Pages Cache API to store summary payloads for BBSTATS_CACHE_TTL_MS and does background refreshes to keep the cache warm while minimizing function executions.