You, like many Glitch app creators, may want to complete a project by pointing a domain you own to one of your Glitch apps. This doc will show you the process of pointing a domain to a Glitch app on Fly.io using their Edge Applications service.
A domain you have access to creating custom resource records (A, CNAME records)
In this doc, I will be pointing a domain I own, dotbiz.dev, to a Glitch app I’ve already created, jennmoney.glitch.me. The following screenshots and directions are all within the Fly.io dashboard that I see when I log in.
Log into your Fly.io account and from within the Dashboard, click the “Create new app” button on the top right of the page.
In the “Create new app” modal, give your app a descriptive name (I named it after the Glitch app I’ll be working with)
You should then end up in the “Overview” section of your new app.
Go to “Hostnames” so we can set up our custom domain’s DNS records to point to this app. Click the “Add hostname” button and enter the hostname you want (I added dotbiz.dev)
Now that the hostname has been entered, click the “View” button on it’s row in the table so we can start configuring the DNS.
A modal window will pop up that gives you instructions on what DNS records you need to create wherever your domain comes from. Sometimes these records take awhile to start working, and it can be a frustrating waiting game. You can click “Check again” in the modal every few minutes to see if all the dots go green - when they are all green, you’re ready to tell Fly.io what your Glitch app is. Note - if your dns provider says you can only add an ip address for an a record, you can run dig [url the instructions give you] in your local (or glitch app's!) terminal to get an ip address to enter. in this example, i entered dig jennmoney.edgeapp.net.
Go to “CDN” and delete the existing record under “Backends” and then click “Add backend”
“New backend” is where we tell Fly.io what app we are going to create routing rules from our domain to our Glitch app. Select “Glitch application.”
In the “Add Glitch Application Backend” modal, enter the name of your Glitch app - which is the first part of the glitch.me URL of the app you want your domain to point to (mine is jennmoney).
Fly.io knows our hostname and they know our Glitch app. Now we just need to add “Routing rules” to make the connection between the two. Under “Routing rules” click “Add rule”, which will open the “Add rule” modal. Add your hostname (I added “dotbiz.dev”) and under “Action” click “Use a backend.” You’ll then see a dropdown below that where you can select the Glitch app you previously added.
If everything has been set up, your domain should now point to your glitch app - see how dotbiz.dev takes you to jennmoney.glitch.me
You should be all set! If you want to add more domains or subdomains to this app (for example, I also want to add www.dotbiz.dev), add the hostname and route rules like you did in the previous instructions.