Viewers: Deploying static files into Tomcat

Created on 13 Jan 2020  路  4Comments  路  Source: OHIF/Viewers

I have a Tomcat folder called ohifwhere i want to deploy platform/viewer/dist content. However, OHIF is not able to find its static files. Here is a screenshot of what happens:

72273401-0bdf2380-3609-11ea-8112-15bf266f71e0

Tomcat runs at http://149.56.20.137:17545 and i want to serve OHIF at http://149.56.20.137:17545/ohif

Ultimately what i want to do is connect OHIF with an Orthanc instance behind a NGINX reverse proxy. So the final result would be accessing OHIF at http://149.56.20.137:17000/ohif and Orthanc at http://149.56.20.137:17000/orthanc

The steps i used to generate static files:

  1. yarn config set workspaces-experimental true
  2. yarn install
  3. yarn run build

Then i copied platform/viewer/dist content into webapps/ohif folder on Tomcat.

Community

All 4 comments

As recommended here, by appending PUBLIC_URL=/ohif to the build:viewer script configuration on platform/viewer/package.json i was able to correct some dependencies, but some files are still missing:

Sem t铆tulo

Silly mistake. Changed PUBLIC_URL=/ohif to PUBLIC_URL=/ohif/ and everything worked (including Orthanc behind NGINX)! :)

Here is the relevant platform/viewer/package.json relevant line for anyone wondering:
Sem t铆tulo

Quite slow performance to query studies, but i think that's something on Orthanc's side.

Now what i am trying to understand is when i access http://149.56.20.137:17000/ohif/, OHIF shows this screen:

Sem t铆tulo

If i click on go back, i can see the list connected to Orthanc showing everything as expected, but the browser URL changes to http://149.56.20.137:17000/

EDIT: solution was to change default.js routerBasename from '/' to '/ohif/', matching the PUBLIC_URL and Tomcat's folder name.

Awesome! That's great to hear. We should probably auto-append the trailing slash if it's not there. I can't think of a scenario where you wouldn't apply it. :thinking:

Another common "gotcha" are the SPA redirect rules that allow direct linking to specific studies. You may want to make sure you have those in place.

If all has been resolved, feel free to close this issue. Please don't hesitate to create a new issue, or PR document or code changes to help others with lessons you learned along the way.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TZubiri picture TZubiri  路  3Comments

rossetantoine picture rossetantoine  路  5Comments

szwang-wthealth picture szwang-wthealth  路  3Comments

AtmiyaVaghela picture AtmiyaVaghela  路  4Comments

bhavesh-pandey picture bhavesh-pandey  路  5Comments