Browse Source

extracted APP_IMPORT_STRING for monkey patching

Rodja Trappe 1 year ago
parent
commit
f1f173d032
1 changed files with 3 additions and 1 deletions
  1. 3 1
      nicegui/run.py

+ 3 - 1
nicegui/run.py

@@ -16,6 +16,8 @@ from . import native as native_module
 from . import native_mode
 from .language import Language
 
+APP_IMPORT_STRING = 'nicegui:app'
+
 
 class Server(uvicorn.Server):
 
@@ -124,7 +126,7 @@ def run(*,
     # NOTE: The following lines are basically a copy of `uvicorn.run`, but keep a reference to the `server`.
 
     config = uvicorn.Config(
-        'nicegui:app' if reload else globals.app,
+        APP_IMPORT_STRING if reload else globals.app,
         host=host,
         port=port,
         reload=reload,