diff --git a/README.md b/README.md index 73f5513..e301c3d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A self-hosted drop-in replacement for [CounterAPI](https://counterapi.com) built on [Cloudflare Workers](https://workers.cloudflare.com/) + [KV](https://developers.cloudflare.com/kv/). CounterAPI went down in May 2026 without notice; this gives you the same API surface on infrastructure you own. -![CounterAPI Worker README views](https://counter.avikalp.workers.dev/api/github.com/avikalpg/counterapi-worker/views/readme?format=svg&label=README%20views) +![CounterAPI Worker README views](https://counter.avikalp.workers.dev/api/github.com/views/avikalpg/counterapi-worker/readme?format=svg&label=README%20views) This README uses the Worker above to count its own views. Dogfooding matters: the Markdown badge is a normal request to the hosted Worker, not a static screenshot. @@ -25,11 +25,16 @@ GET /api/{namespace}/views/{key} ``` Auto-increments on each request and returns `{ value, iconSvg }`. -For an embeddable SVG badge: +For a generic Markdown badge, use any namespace and key: ```md ![views](https://counter.YOUR_SUBDOMAIN.workers.dev/api/your-site.com/views/page-key?format=svg&label=views) ``` +For a GitHub repository README badge, use `github.com` as the namespace and keep the repository slug in the key: +```md +![README views](https://counter.YOUR_SUBDOMAIN.workers.dev/api/github.com/views/OWNER/REPO/readme?format=svg&label=README%20views) +``` + ### Like counter (read) ``` GET /api/{namespace}/vote/{key}?readOnly=true @@ -82,7 +87,7 @@ fetch(`https://counter.YOUR_SUBDOMAIN.workers.dev/api/your-site.com/views/page-k That's it. The response shape is identical. -For GitHub READMEs or HTML image badges, use the SVG format: +For HTML image badges, use the SVG format: ```html Views ```