Lesson 10 · about 20 minutes
A real address
Swap my-app.you.workers.dev for a name like myapp.com. The trick is doing it without breaking the app for anyone who already added the old address to their home screen.
A custom domain on the same Worker, with workers.dev kept on, the DNS clean-up, the caching snags, and moving installed users across.
You'll add a custom domain to the Worker. The catch: adding a route turns off the workers.dev address unless you keep workers_dev on, and that breaks the app for anyone who installed it from there. We also cover clashing DNS records, old redirects your computer remembers, and why each address is a separate install.
What you'll make
- Your app at your own domain
- The old address still working
- Ready to send email from your domain
You'll need: an app online (lesson 2).
Get a domain
Buy one at Cloudflare's registrar (in the dashboard under Domain Registration), or if you already own one elsewhere, move its nameservers to Cloudflare. Prices vary by name; common ones are often around £10 a year.
My domain has an old website on it
Point it at your app
Both addresses keep working while people move over.
Your app at your own name. Cloudflare sets up the secure certificate (the padlock) for you.
Your agent may need you to click one or two things in Cloudflare's dashboard; it'll give you numbered steps.
Keep the old address working
Every address is a separate app on a phone, with its own sign-in. If the old address stops working, everyone who added it to their home screen loses the app.
Lesson learned: adding a custom domain can switch off the old workers.dev address by default. This once took a real app offline for two minutes. Ask your agent to keep it on.
Check it from more than one device
It works on my phone but not my laptop
www doesn't work but the plain name does
Move people over
Tell people to open the new address and add it to their home screen again, then delete the old icon. They'll sign in once on the new one.
Email from your domain
With your domain on Cloudflare, your app can send from hello@yourdomain: sign-in codes, confirmations, reminders (lesson 5). Remember: emailing anyone other than yourself needs Workers Paid.
Did it work?
Tick these off. They're saved in this browser, so you can come back later.
- My app opens at my own domain
- The old workers.dev address still works
- I checked it on my phone and my computer
- People know to re-add the app from the new address