Building a Self-Hosted URL Shortener with Cloudflare Workers
Clone the companion repo: All production code from this guide is available at IAMDevBox/cloudflare-url-shortener — worker.js, wrangler.toml, Python client, and integration tests, ready to deploy. The Problem: Twitter’s 280-Character Limit When sharing technical blog posts on Twitter, I constantly hit the 280-character limit. Long URLs consume precious space that should be used for actual content. For example: Full URL with UTM: 155 characters https://iamdevbox.com/posts/building-complete-oidc-login-flow-urls/?utm_source=twitter&utm_medium=social&utm_campaign=blog_post Available for content: Only 125 characters This leaves barely enough room for a meaningful tweet. Third-party URL shorteners like Bitly work, but they: ...