I encountered a similar problem, thanks for flagging me in @Robert_Autenrieth.
I have created this PR to allow specifying the JSON API server port with the environment variable REACT_APP_HTTP_JSON_PORT. I plan to merge the PR today.
However, I don’t think this is sufficient for @gaborh’s use-case, since it will not allow a single instance of the UI to connect to multiple instances of the JSON API.
My suggestions for Gabor’s use-case are:
- Write a custom API server that takes a JSON API call and proxies the call to the right JSON API server, as suggested by @Robert_Autenrieth. This would give you maximum flexibility.
- Modify the file
setupProxy.js from my PR to use router options, as documented here. For example, a configuration like this may work for you:
'/bob' : 'http://localhost:7500',
'/alice' : 'http://localhost:7501'
and in this example Alice’s instance of the Daml-UI-template should point at the url http://localhost:3000/alice, so that it gets proxied to
http://localhost:7501. The main disadvantage here is that you need to statically pre-configure all the parties you want to use. But it will probably be faster to get running than option 1, and less code.
- If only for a demo on your machine, you can start chrome without the CORS check using
--disable-web-security (see here) but be careful with this one ofc, perhaps turn off your network connection before you try it out