Run app from command line using uvicorn if available.
Source code in docs/rs-server/services/catalog/rs_server_catalog/main.py
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38 | def run():
"""Run app from command line using uvicorn if available."""
try:
import uvicorn # pylint: disable=import-outside-toplevel
uvicorn.run(
"rs_server_catalog.app:app",
host=settings.app_host,
port=settings.app_port,
log_level="info",
reload=settings.reload,
reload_dirs=[dir.strip() for dir in os.getenv("RELOAD_DIRS", "").split(",") if dir],
# NOTE: don't set workers= use the WEB_CONCURRENCY env var instead
root_path=os.getenv("UVICORN_ROOT_PATH", ""),
)
except ImportError:
raise RuntimeError("Uvicorn must be installed in order to use command") # pylint: disable=raise-missing-from
|