when using fastboot, how should one let ember data know about the backend location? preferably not hard coding urls into the ember app
If I deploy a fastboot app server and an ember app which uses the ember-data rest adapter and do not configure any host within the adapter, the fastboot server tries to reach the backend on its own port. For instance, if fastboot is running on port 4000, I can see via tcpdump, that it tries to connect to the backend at localhost:4000. So, this seems to get us nowhere…
Now, there are two options: configure a host with the adapter, which specifies a public uri to the backend (using the same uri from the browser as from the fastboot server). Or we could use a public uri from the browser and stay within the private network when the request originates from the fastboot server.
As it seems at very least unnecessary to leave the private network, I was trying to specify a different host variable in the rest adapter depending wether we are running in fastboot mode or not. While this generally worked, I quickly noticed that this approach broke addons like the ember storefront fastboot adapter, as it uses the whole uri when deciding if it could server data from the shoebox - and now being unable to use data from the fastboot shoebox in the browser.
As all these points seem like pretty basic things when setting up fastboot, either a lot more people should have similar issues, or probably I am missing something pretty fundamental or doing something the wrong way? Unfortunately I wasn’t able to find anything within the docs or via employing a search engine, so how are you handling these issues?