Redirect-as-a-Service on Cloudflare Workers.
A "pro" blueprint for managing short-links and installation scripts. Built for developers who want a custom vanity domain for their `curl | bash` installers and deep control over their redirects.
- KV-Backed: Fast, globally distributed redirects.
- Admin UI: Built-in terminal-style management interface.
- Management API: Fully RESTful API for integration.
- Pattern Fallback: Automatically resolves to GitHub raw content if no custom link is found.
- Portable: One file, easy to deploy.
- Clone & Install:
npm install - Create KV:
wrangler kv:namespace create REDIRECTS - Update `wrangler.toml`:
- Paste your KV ID in the
[[kv_namespaces]]section. - Set your custom domain in the
routessection. - Update the
[vars]with your GitHub username and site.
- Paste your KV ID in the
- Set Secrets (CRITICAL):
# Set your admin password for the /admin panel wrangler secret put ADMIN_PASS # Optional: Set your GitHub token for Auto-Sync wrangler secret put GITHUB_TOKEN
- Deploy:
wrangler deploy
- Never commit your KV ID or secrets to GitHub. The
wrangler.tomlin this repo uses placeholders. - Basic Auth: The
/adminand/apiroutes are protected by Basic Auth usingADMIN_USERandADMIN_PASS. - Custom Domain: Ensure your domain is managed by Cloudflare to use the
custom_domain = truefeature.
- Redirect: `sh.yourdomain.com/my-tool`
- Admin: `sh.yourdomain.com/admin`
- API: `GET/POST /api/links`
Built for the physical and digital world.