(
env: Environment, port: int, host: str, open_browser: bool, uvicorn_log_level: str
)
| 146 | ) |
| 147 | @pass_env |
| 148 | def run_server( |
| 149 | env: Environment, port: int, host: str, open_browser: bool, uvicorn_log_level: str |
| 150 | ): |
| 151 | app = make_app() |
| 152 | |
| 153 | def after_startup(): |
| 154 | if open_browser: |
| 155 | url = f"http://{host}:{port}" |
| 156 | env.logger.info("Opening URL %s in the browser", url) |
| 157 | webbrowser.open(url) |
| 158 | |
| 159 | config = uvicorn.Config(app=app, port=port, host=host, log_level=uvicorn_log_level) |
| 160 | server = StartupCallbackServer(config=config, startup_callback=after_startup) |
| 161 | server.run() |
nothing calls this directly
no test coverage detected