From e9cc87e246d08ce6ff6fccfba8e1fe49b2a5add6 Mon Sep 17 00:00:00 2001 From: chenpanliang <3245129380@qq.com> Date: Tue, 16 Dec 2025 14:11:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(api):=20=E6=B7=BB=E5=8A=A0API=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E8=B7=AF=E7=94=B1=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 为FastAPI应用添加docs、redoc和openapi.json的路由配置,使用API_PREFIX作为基础路径 --- src/main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 0f25152..3d69124 100644 --- a/src/main.py +++ b/src/main.py @@ -16,7 +16,10 @@ app = FastAPI( title=APP_NAME, description="信息灯板", debug=DEBUG, - version=APP_VERSION + version=APP_VERSION, + docs_url=API_PREFIX + "/docs", + redoc_url=API_PREFIX + "/redoc", + openapi_url=API_PREFIX + "/openapi.json" ) app.add_middleware(