
Open-sourced a short-link redirector built on Cloudflare (using D1) + you can email it
I built this for www.salaryconfidential.com but figured other people may have use for it, so I've open-sourced:
fwd
- At https://github.com/qvgdlaem/fwd ), which is a link redirector you can use on your domain, subdomain and, if you have a reverse proxy, on a /namespace/* of your choice so you have branded short links.
- If you use a reverse proxy, you can designate any /namespace/ for your short links like yourmaindomain.com/go/your-short-link and you can have multiple /namespaces/ for semantic variance (go, win etc) . See below, because I open-sourced a reverse-proxy that can bind to Cloudflare workers
- You can create new shortlinks on the fly, by designating an email address for fwd (like fwd@yourdomain.com) and emailing the key:value pair. (Authentication of the email means whitelisting the email addresses that can email fwd, and setting a secret that needs to be part of the email body).
Requirement: A worker for Fwd; a D1 db for the short links and user management
And enable email on your domain for cloudflare if you want to use the Email feature)
A Cloudflare reverse-proxy
https://github.com/qvgdlaem/cf-reverse-proxy
This one can reverse proxy to other workers by bindings (score - it's so fast) or to regular url upstreams on anything (vps, railway, a bare ip, whatever
Just set up your wrangler to designate any /namespace/* to point to whatever upstream destination
Extensibility of Fwd
If you wanted to turn fwd into a clone of Linktree, it would be very easy (i debated throwing that in for free - i just have no need for this myself). All you need is extend the data model of D1 to handle a notion of an <item> with link, link text, media etc
A way to browse up the images (that you can store in D1 too) and a light bit of UI to manage the linktree screens
Anyway, it's MIT license so you can do anything you wish