Setting up Netlify / Heroku front and backend on the same domain Setting up Netlify / Heroku front and backend on the same domain heroku heroku

Setting up Netlify / Heroku front and backend on the same domain


As you only have trouble to add the backend on a subdomain, here is what you should do:

1 - Add the domain with the subdomain to the Heroku app:

In the Heroku dashboard, go to the app's settings. Click "Add domain" and type the domain with the subdomain you want (e.g: api.yourcustomdomain.com)

You'll then be prompted the DNS target:

enter image description here

2 - Add the DNS target to Google domain

In the DNS manager of your domain in Google domains, simply add a CNAME record with the DNS target, it should looks like something like this:

enter image description here

Allow some time for the DNS to propagate and it should work !