niivue / niivue-vscode

NiiVue extension for vscode + standalone web app
https://niivue.github.io/niivue-vscode/
MIT License
24 stars 7 forks source link

Running niiview on a remote system #70

Open vikashg opened 1 month ago

vikashg commented 1 month ago

Hi I am interested in running nii view on a remote server. I tried npm run dev -- --host. But my webpage doesnt really load it remains blank.

  VITE v5.3.4  ready in 247 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: http://x.x.x.x:5173/
  ➜  Network: http://x.x.x.x:5173/
  ➜  Network: http://x.x.x.x:5173/
  ➜  press h + enter to show help

Removed the IP with x.x.x.x

korbinian90 commented 1 month ago

The web app always runs in the browser, it doesn't have a server backend.

Vite is only used for development, so it's think the webpage it hosts might be only accessible from the same local network. But this is the same as https://niivue.github.io/niivue-vscode/. This is a web app version, it runs in the browser and has no remote support. Vite compiles the typescript code to Javascript, the code still runs in your local web browser. You wouldn't be able to access files on the remote machine, only local files (on the machine that opened the page in the browser) or links to online hosted images.

For viewing images on a remote machine, I use vscode to connect to the remote machine and install the niivue extension in the remote vscode window.

What is your goal?

vikashg commented 1 month ago

I do not know a lot about node js or vite. I will read about this. However if i may explain. Is it possible to run niiview such that i start it while exposing the host and i can access it on a different computer by going to the url http://x.x.x.x:5173/index.html

My goal is to host niiview on an EC2 instance and then access it using the ip address of the EC2 instance

korbinian90 commented 4 weeks ago

Currently it is not possible to host Niivue, since it doesn't have a backend, it runs purely in the browser of the local machine.

But you can use the vscode solution: 1) use vscode to connect to the remote machine 2) install the Niivue vscode extension in the remote session 3) open image files in the vscode file browser to render them with Niivue vscode handles all the complicated remote connection things, no custom server is required