Skip to content

Commit

Permalink
extracted APP_IMPORT_STRING for monkey patching
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Jun 17, 2023
1 parent bde46be commit f1f173d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nicegui/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from . import native_mode
from .language import Language

APP_IMPORT_STRING = 'nicegui:app'


class Server(uvicorn.Server):

Expand Down Expand Up @@ -124,7 +126,7 @@ def split_args(args: str) -> List[str]:
# 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,
Expand Down

0 comments on commit f1f173d

Please sign in to comment.