Closed cchriste closed 7 years ago
I've been thinking about this problem. I guess the solution would be to have a config file for the viewer (e.g. a config.js file) that sets the right "things" for the specific deployment. So that you can place the code everywhere you want but change the configuration on each machine. For example, if the deployment of this viewer is done through docker it should point to localhost (to the local server) by default, this is not true for other deployments. What do you think? (@cchriste @scrgiorgio)
It's not even so nice for Docker deployments: if you run a docker on one machine but try to access its web viewer from another machine, "localhost" in this case will still refer to the client machine, not the server.
So the default should be the hostname of where it is deployed.
In any case would be solved with external config file.
On Sep 12, 2017, at 5:02 PM, Cameron Christensen notifications@github.com wrote:
It's not even so nice for Docker deployments: if you run a docker on one machine but try to access its web viewer from another machine, "localhost" in this case will still refer to the client machine, not the server.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub, or mute the thread.
Now the viewer.html includes src/config.js that contains a variable to set the URL of the server.
This can be edited for each deployment.
Example: I run the server on my system at SCI and try to access the web viewer from another system. Instead, I need to enter that system's hostname, not localhost.