Deploying on the same domain is simple using sub-domains. An API Gateway can be configured to route each sub-domain (and even every request) to a different server or cluster. For example, serve the app directly on the default domain through a CDN like S3 and setup the "api." sub-domain as the service gateway which routes requests to a private network.
Yes indeed deploying to sub domains is the preferred method most of the times. When i said to avoid deploying them to the same domain i meant to avoid having a scenario where your app is served from the same web server that serves the api, like yourdomain.comfor the app and yourdomain.com/api for the api.
Deploying on the same domain is simple using sub-domains. An API Gateway can be configured to route each sub-domain (and even every request) to a different server or cluster. For example, serve the app directly on the default domain through a CDN like S3 and setup the "api." sub-domain as the service gateway which routes requests to a private network.
Yes indeed deploying to sub domains is the preferred method most of the times. When i said to avoid deploying them to the same domain i meant to avoid having a scenario where your app is served from the same web server that serves the api, like
yourdomain.com
for the app andyourdomain.com/api
for the api.Yea, agreed. This would make scaling a hassle.