Skip to content

Commit eabcc0c

Browse files
authored
Update cli.py
生产环境时, backend/cli.py 中, openapi_url = url + settings.FASTAPI_OPENAPI_URL 这一行会报错(此时settings.FASTAPI_OPENAPI_URL值为None), 修改为 openapi_url = url + (settings.FASTAPI_OPENAPI_URL or '')
1 parent dcf235d commit eabcc0c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def run(host: str, port: int, reload: bool, workers: int | None) -> None:
3434
url = f'http://{host}:{port}'
3535
docs_url = url + settings.FASTAPI_DOCS_URL
3636
redoc_url = url + settings.FASTAPI_REDOC_URL
37-
openapi_url = url + settings.FASTAPI_OPENAPI_URL
37+
openapi_url = url + (settings.FASTAPI_OPENAPI_URL or '')
3838

3939
panel_content = Text()
4040
panel_content.append(f'📝 Swagger 文档: {docs_url}\n', style='blue')

0 commit comments

Comments
 (0)