OHIF / Viewers

OHIF zero-footprint DICOM viewer and oncology specific Lesion Tracker, plus shared extension packages
https://docs.ohif.org/
MIT License
3.29k stars 3.33k forks source link

How to change default server address #788

Closed qaler closed 5 years ago

qaler commented 5 years ago

Hello Ohif devs, thanks for the great open source image viewer project. By default, ohif listens on the http://localhost:3000, how could I change (or bind) to 0.0.0.0:MY_PORT ? Thanks in advance!

qaler commented 5 years ago

For now, I am modifying the ./platform/viewer/.webpack/all.dev.js file. Not sure if it is allowed since this folder is hidden, but it works as the ohif server is started by wds.

dannyrb commented 5 years ago

Modifying that config, passing the ip/port as a CLI option for the NPM script, or modifying the root webpack common config are probably all equally fine options.

I wouldn't think of anything as hidden. Anything is fair game for reviewing and change. Tooling is grouped and fine to play with. Source code can also be modified, but if you stray from established extension points you may have more difficulty maintaining a fork.

qaler commented 5 years ago

Many thanks! I'll do my search based on your post.

vnarepalepu commented 5 years ago

Hi @qaler, were you able to figure this out? Should a new environment variable be added in any of the js files within .webpack? Appreciate any help on this. Also I wasn't sure what needs to be modified in all.dev.js file as none of them seem to be pointing towards a URL path

vnarepalepu commented 5 years ago

Hi @qaler, were you able to figure this out? Should a new environment variable be added in any of the js files within .webpack? Appreciate any help on this. Also I wasn't sure what needs to be modified in all.dev.js file as none of them seem to be pointing towards a URL path

Okay got it. added 'host' in /platform/.webpack/all.dev.js: devServer: { host: 'ip address', }

dannyrb commented 5 years ago

@vnarepalepu, quick note, you should not be using the Webpack Development Server to host your production instance. The only good reason to modify this configuration is to TEST on other devices that have access to the same local network (ie. Phones, tablets, other desktops).

vnarepalepu commented 5 years ago

Thank You for getting back @dannyrb. I'v chekced

  • Viewers/.webpack/webpackcommonjs.js
  • Viewers/platform/viewer/.webpack/webpackcommonjs.js

but didn't seem to understand how and where to provide the port/host as it was in all.dev.js for the namespace devServer { }. Should it be something like prodServer{ } in one of the files above?

Thanks for the great open source image viewer. Just hanging on there to figure out how it would be feasible for our requirements within MGH (Mass Gen Hospital)

@vnarepalepu, quick note, you should not be using the Webpack Development Server to host your production instance. The only good reason to modify this configuration is to TEST on other devices that have access to the same local network (ie. Phones, tablets, other desktops).

dannyrb commented 5 years ago

I think there may be some confusion. The source code for the OHIF Viewer can be used to generate a collection of static assets (HTML, CSS, JS). You should host these on a Web Server fit for production. Popular ones include:

nginx, apache, iis, tomcat

We provide no server side solution for production. The WebPack Dev Server is simply a convenience to make it easier to develop and test the application locally.

If you're having trouble evaluating the OHIF Viewer or planning how it should be deployed in a production environment, you may wish to reach out to a consultant.

vnarepalepu commented 5 years ago

Alright Thanks @dannyrb. I am using apache webserver and have a website hosted on it through ports 80 & 443. And was looking to click on the data links from the website to open locally stored dicom files in a folder using OHIF viewer. Okay, so now I assume I'll have to host OHIF viewer on apache with a different port so that I can use it for production. Thanks I'll go through the docs again and will reach out to any consultant as necessary. Appreciate for the help