From b924f18141beff4a8c36b52dad58a0e15f145fe2 Mon Sep 17 00:00:00 2001 From: chenwj <654891551@qq.com> Date: Sat, 20 May 2023 23:43:33 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=87=BA=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 5 ----- main.py | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 5 deletions(-) delete mode 100644 app.py create mode 100644 main.py diff --git a/app.py b/app.py deleted file mode 100644 index 7cd2dfa..0000000 --- a/app.py +++ /dev/null @@ -1,5 +0,0 @@ - -from fastapi import FastAPI - -app = FastAPI() - diff --git a/main.py b/main.py new file mode 100644 index 0000000..e4fbca7 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ + +from fastapi import FastAPI + +def create_app(): + app = FastAPI() + + # 添加路由 + from src.api import index + app.include_router(index.router, prefix="/api/v1", tags=["API首页"]) + + + return app + +fast_api_app = create_app() +