I've been getting stuck on how to deploy my React SPA front end on Netlify and my NodeJS Express api backend on Heroku using the same domain name. The domain is a Google Domain and currently the Netlify front end works just fine at www.MyDomain.com.
What I've been trying to get set up is a way to have something like api.MyDomain.com/api/v1/endpoint be able to call the backend service hosted on Heroku. I've tried setting up subdomains via Google Domains for api.MyDomain.com and Netlify redirects to api.myDomain.com whenever accessing any routes like www.MyDomain.com/api/* but I haven't been able to make any progress.
Is it possible to host a single page Netlify front end and an express api heroku backend on the same domain? If anyone has experience with this combination that could point me in the right direction that would be awesome. Thank you.