We’ve got our app running on Heroku, which is great. As a brief aside, I’m going to show you how to get a real domain pointing to this site. You can skip this chapter if you like, but it takes a couple of hours for the domain name to become operational so you might want to do this sooner rather than later.
Register on https://www.namecheap.com/ and search for a domain name, and add it to your cart. I’m going to buy memespace.xyz because it’s only a dollar. Complete the checkout process.
Once that’s complete, go back to the home page and navigate to your dashboard with the following menu option, and click manage on your new domain name.
Now set up your DNS records to look like mine below. Use your own Heroku domain name, of course.
The last step is just to tell Heroku to allow this alias. Log in to Heroku in your browser, log in, and navigate to your app settings, which looks like this:
Scroll down to the Domains section and add entries resembling the following:
And that’s actually all completed. Your site still may not be working. It might look something like below, or it might still be redirecting you to a domain parking page.
This is because of the way DNS works. You’ve updated the DNS records on Namecheap, but these changes need to propagate through DNS servers around the world, eventually reaching the one you’re connected to. This should only really take a few hours, but it could take a day or two.
One way to avoid waiting for DNS updates to propagate is to use a reverse proxy like Cloudflare. You still have to wait some time when you initially set it up for a site, but after that, all DNS changes you make through Cloudflare are instant. The reason is because all traffic is always redirected through Cloudflare, so only Cloudflare actually looks at your DNS settings.
That’s it for this brief chapter. In the next one, we’re going to add Facebook authentication.