Spaces:
Sleeping
Sleeping
Raymond Weitekamp commited on
Commit ·
53145e1
1
Parent(s): 0b7876b
Remove base_url parameter which is not supported in nicegui Web
Browse files- Dockerfile +1 -1
- cadviewer.py +1 -6
Dockerfile
CHANGED
|
@@ -38,4 +38,4 @@ RUN wget https://github.com/gitpod-io/openvscode-server/releases/download/openvs
|
|
| 38 |
EXPOSE 7860
|
| 39 |
|
| 40 |
# Run the application
|
| 41 |
-
CMD ["python", "-c", "import cadviewer; from nicegui import app; app.native.start_args['port'] = 7860;
|
|
|
|
| 38 |
EXPOSE 7860
|
| 39 |
|
| 40 |
# Run the application
|
| 41 |
+
CMD ["python", "-c", "import cadviewer; from nicegui import app; app.native.start_args['port'] = 7860; cadviewer.ui.run(native=False, host='0.0.0.0', port=7860)"]
|
cadviewer.py
CHANGED
|
@@ -38,10 +38,6 @@ from nicegui.events import KeyEventArguments
|
|
| 38 |
import subprocess
|
| 39 |
import os
|
| 40 |
|
| 41 |
-
# Get the Spaces URL from environment
|
| 42 |
-
SPACE_URL = os.getenv('SPACE_URL', '')
|
| 43 |
-
BASE_URL = f"/{SPACE_URL}" if SPACE_URL else ""
|
| 44 |
-
|
| 45 |
app.native.window_args["resizable"] = True
|
| 46 |
app.native.start_args["debug"] = True
|
| 47 |
# app.native.settings['ALLOW_DOWNLOADS'] = True # export "downloads" ?
|
|
@@ -119,8 +115,7 @@ ui.run(
|
|
| 119 |
host='0.0.0.0', # Listen on all interfaces
|
| 120 |
port=8080, # Use port 8080 for Spaces
|
| 121 |
title="nicegui-cadviewer",
|
| 122 |
-
reload=False
|
| 123 |
-
base_url=BASE_URL # Add base_url for Spaces
|
| 124 |
)
|
| 125 |
# ui.run(native=True, window_size=(1800, 900), fullscreen=False, reload=True) #use reload=True when developing rapidly, False helps exit behavior
|
| 126 |
|
|
|
|
| 38 |
import subprocess
|
| 39 |
import os
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
app.native.window_args["resizable"] = True
|
| 42 |
app.native.start_args["debug"] = True
|
| 43 |
# app.native.settings['ALLOW_DOWNLOADS'] = True # export "downloads" ?
|
|
|
|
| 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 |
)
|
| 120 |
# ui.run(native=True, window_size=(1800, 900), fullscreen=False, reload=True) #use reload=True when developing rapidly, False helps exit behavior
|
| 121 |
|