We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef1d649 commit 5f39707Copy full SHA for 5f39707
src/fastapi_cli/cli.py
@@ -1,7 +1,7 @@
1
import importlib
2
from logging import getLogger
3
from pathlib import Path
4
-from typing import Any, Union
+from typing import Any, Final, Union
5
6
import typer
7
import uvicorn
@@ -16,6 +16,8 @@
16
from . import __version__
17
from .logging import setup_logging
18
19
+DEFAULT_DOCS_URL: Final[str] = "/docs"
20
+
21
app = typer.Typer(rich_markup_mode="rich")
22
23
setup_logging()
@@ -50,7 +52,7 @@ def _get_docs_url(uvicorn_path: str) -> str:
50
52
module_path, app_name = uvicorn_path.split(sep=":")
51
53
module = importlib.import_module(module_path)
54
app = getattr(module, app_name)
- return app.docs_url
55
+ return app.docs_url or DEFAULT_DOCS_URL
56
57
58
def _run(
0 commit comments