Basically, Heroku gives you a domain named by default: XXX.herokuapp.com
.
On my own, I have a set of REST apis that I would like to set on a domain named: api.myDomain.com
.
On the same time, I have my HTML files (web view) distributed by the same server as the REST API.
It's similar to this; embedding static files on server in a dist
folder.
I expect the domain serving those HTML/JS files to be www.myDomain.com
.
I thought about putting them clearly on a distinct server dedicated to static files, but the fact is that Single Page Application should be controlled by a server, in order to make the refresh works (F5 redirecting to index.html
), that's why I chose to use the same server as REST apis.
An alternative would be to dedicate ANOTHER server to treat only static files, independent of the REST Apis' server.
How to deal with both domains (api
and www
) while sources being on the same servers?
Or should I completely rethink the strategy?