A lightweight self-hosted URL shortener built on Cloudflare Workers and KV.
GET /- application status.GET /admin- management panel with token login.GET /:slug- direct redirect or landing page with countdown.- Link creation, editing, deletion, and click tracking through the admin panel.
- Install dependencies:
npm install- Create a KV namespace:
npx wrangler kv namespace create KV_NAMESPACE
npx wrangler kv namespace create KV_NAMESPACE --preview- Paste the returned
idandpreview_idintowrangler.toml. - Set the admin token:
npx wrangler secret put AUTH_TOKENFor local development, you can copy .dev.vars.example to .dev.vars.
npm run devThe panel will be available at /admin.
npm run deploy