Url-Shorten-Worker is a free, open-source (MIT) URL shortener and pastebin that runs entirely on Cloudflare Workers + Workers KV. The whole backend is a single index.js file — deployment takes about 5 minutes: create a KV namespace, paste the code, bind a domain. On the Workers free tier it costs $0/month to run.
Features: custom slugs, per-link expiry, built-in CAPTCHA on link creation, pastebin mode storing up to 10 MiB texts with a ?raw=1 raw view, optional Google Safe Browsing screening, and docs in English and Chinese. No database server to manage — it scales automatically with traffic.
Repo: https://github.com/xyTom/Url-Shorten-Worker
Live demo of the code: https://lnks.eu.org
Comments
Add a Comment View all commentsA single index.js on Workers KV keeps this very easy to deploy. With the pastebin mode holding up to 10 MiB texts, how do you handle KV's eventual consistency, for example a link that was just created but is not yet readable from another region?