浏览代码

Merge pull request #842 from Viicos/run-with-path

Add a `mount_path` parameter to `run_with`
Falko Schindler 2 年之前
父节点
当前提交
97e6e292a2
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      nicegui/run_with.py

+ 2 - 1
nicegui/run_with.py

@@ -14,6 +14,7 @@ def run_with(
     dark: Optional[bool] = False,
     dark: Optional[bool] = False,
     binding_refresh_interval: float = 0.1,
     binding_refresh_interval: float = 0.1,
     exclude: str = '',
     exclude: str = '',
+    mount_path: str = '/',
 ) -> None:
 ) -> None:
     globals.ui_run_has_been_called = True
     globals.ui_run_has_been_called = True
     globals.title = title
     globals.title = title
@@ -27,4 +28,4 @@ def run_with(
     app.on_event('startup')(lambda: handle_startup(with_welcome_message=False))
     app.on_event('startup')(lambda: handle_startup(with_welcome_message=False))
     app.on_event('shutdown')(lambda: handle_shutdown())
     app.on_event('shutdown')(lambda: handle_shutdown())
 
 
-    app.mount('/', globals.app)
+    app.mount(mount_path, globals.app)