Repository navigation
feat(ops): a static page that asks the worker once for its numbers - #96
Merged
Merged
Conversation
The page is now a static asset, served without running the worker. The worker answers one JSON request, /api/usage, with the month so far and the last seven days, which the browser keeps for five minutes. Switching the period or the plan redraws in the browser from that answer, with no reload and no new request to Cloudflare's analytics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssets Deployed with `wrangler deploy`, the page is a static asset and the worker sees only /api/usage. Deployed from the bundle alone, src/entry.ts serves the same page, which the browser keeps for an hour. compatibility_date moves above [assets], where it was being read as an assets setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The operations page is now a static asset, served without running the worker.
/api/usage, behind the same Cloudflare Access check. It answers with the month so far, the last seven days and the relay's kept totals, which is enough for every view. The browser reuses that answer for five minutes.npm run buildinlines the browser code intodist/index.html, andwrangler.tomlservesdistas assets, with/api/*going to the worker.Tests: 14 pass in
packages/ops. The page was also checked in headless Firefox against a stand-in API: switching the period and the plan made no second request.🤖 Generated with Claude Code