Closed jvwong closed 3 months ago
This isn't a general solution, e.g. FACTOID_URL
is a config variable, but works for our purposes. Our React version is pretty old (docs aren't even available) and there are some new features to handle these sorts of things....
@jvwong , unlike FACTOID_URL, which is only used by the server-side/backend (client calls webapp's /api/biofactoid proxy instead of calling biofactoid api directly), PC_URL was used both from backend and client side. There was just one use case - downloading data in varios formats directly from PC ws as saving as files - where PC_URL was used from the client. This PR here seems to remove the pre-built/default PC_URL value from the app-ui bundle.js and so the PC_URL environment property set at runtime now applies not only to the backend but also to those client's "download" links!
I think there is something wrong about const envVars = ['NODE_ENV', 'PC_URL', 'FACTOID_URL'];
in the webpack.config.js - likely we do not need the latter two build-time options anymore... these were either never actually used or did not pick up the runtime env value, like in PCURL case... We should be able to set/update at run time (e.g. for a container) any of those ENV properties listed in config.js. Also, I think we do not need any of those DB* properties...
Retrieve the PC_URL from the server endpoint, cache in client.
Refs: #1456