3 ms·
The subdomain approach is the more appropriate because: * DNS routing * Can control/fine tune CORS * Avoid mixing up path routing with other interfaces/servi
by rumanator 7y ago
The subdomain approach is the more appropriate because:
* DNS routing
* Can control/fine tune CORS
* Avoid mixing up path routing with other interfaces/services
* It's more coherent (i.e., page served with www.example.com and REST API at api.example.com)
- giorgioz 7y agoyes I agress subdomain is definitely better than subpath overall. I personally use the subdomain AND subpath approach for a api and an api service (api.example.com/api) This way I have the separate DNS but if I want I can add the API service as a subpath to www.example.com/api using AWS API Gateway and avoid an extra round trip call to the DNS and CORS.