Skip to content

Fix GitHub README badge URL#4

Merged
avikalpg merged 2 commits into
masterfrom
nia/fix-readme-badge-url
May 31, 2026
Merged

Fix GitHub README badge URL#4
avikalpg merged 2 commits into
masterfrom
nia/fix-readme-badge-url

Conversation

@avikalpg

Copy link
Copy Markdown
Owner

Fixes the dogfooded README badge URL so GitHub receives a real SVG image instead of the Worker JSON 404.

The route shape is /api/{namespace}/{type}/{key}. For GitHub repo badges, github.com is the namespace, views is the type, and OWNER/REPO/readme is the key.

Verification:

  • curl -D - https://counter.avikalp.workers.dev/api/github.com/views/avikalpg/counterapi-worker/readme?format=svg\&label=README%20views returns HTTP 200 with content-type: image/svg+xml; charset=utf-8
  • npm test

Use the Worker route shape correctly: github.com stays the namespace, while the repository slug belongs in the key after /views/. Add a copy-paste README example so future repo badges render as SVG.
Comment thread README.md
@avikalpg avikalpg merged commit 755ec2e into master May 31, 2026
1 check passed
@avikalpg avikalpg deleted the nia/fix-readme-badge-url branch May 31, 2026 11:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant