Fork and clone
Create Redis (Upstash recommended)
UPSTASH_REDIS_URL
and UPSTASH_REDIS_PASSWORD
, nums will build a proper REDIS_URL
automatically.Configure environment variables
.env
file in the repo root:/count
, /count.txt
, /badge
, /badge.json
) are public.Run locally
{“id”:“home”,“hits”:1}
from /hit and a number from /count.txt.Deploy to Vercel
https://<project>.vercel.app
(or your custom domain).Add a badge to your README
cacheSeconds
in /badge.json
is clamped to 30–3600 seconds.Troubleshooting
SECRET_TOKEN
in the header or ?token=
./hit?id=…
at least once; verify Redis env vars.