Raymond Weitekamp commited on
Commit
a3020c1
·
1 Parent(s): c112645

Fix ports and hosts for Spaces deployment

Browse files
Files changed (1) hide show
  1. cadviewer.py +3 -3
cadviewer.py CHANGED
@@ -51,7 +51,7 @@ editor_fontsize = 18
51
  def startup_all():
52
  global ocpcv_proc
53
  # spawn separate viewer process
54
- ocpcv_proc = subprocess.Popen(["python", "-m", "ocp_vscode"])
55
  # pre-import build123d and ocp_vscode in main thread
56
  exec("from build123d import *\nfrom ocp_vscode import *")
57
 
@@ -95,7 +95,7 @@ with ui.splitter().classes(
95
  with ui.column().classes("w-full items-stretch border"):
96
  ocpcv = (
97
  ui.element("iframe")
98
- .props('src="http://127.0.0.1:3939/viewer"')
99
  .classes("h-[calc(100vh-3rem)]")
100
  )
101
 
@@ -113,7 +113,7 @@ app.on_shutdown(shutdown_all) # register shutdown handler
113
  ui.run(
114
  native=False, # Changed from True to False for web deployment
115
  host='0.0.0.0', # Listen on all interfaces
116
- port=8080, # Use port 8080 for Spaces
117
  title="nicegui-cadviewer",
118
  reload=False
119
  )
 
51
  def startup_all():
52
  global ocpcv_proc
53
  # spawn separate viewer process
54
+ ocpcv_proc = subprocess.Popen(["python", "-m", "ocp_vscode", "--host", "0.0.0.0"])
55
  # pre-import build123d and ocp_vscode in main thread
56
  exec("from build123d import *\nfrom ocp_vscode import *")
57
 
 
95
  with ui.column().classes("w-full items-stretch border"):
96
  ocpcv = (
97
  ui.element("iframe")
98
+ .props('src="http://0.0.0.0:3939/viewer"')
99
  .classes("h-[calc(100vh-3rem)]")
100
  )
101
 
 
113
  ui.run(
114
  native=False, # Changed from True to False for web deployment
115
  host='0.0.0.0', # Listen on all interfaces
116
+ port=7860, # Use port 7860 for Spaces
117
  title="nicegui-cadviewer",
118
  reload=False
119
  )