12 lines
318 B
Python
12 lines
318 B
Python
import uvicorn
|
|
from fastapi import FastAPI
|
|
from src.routers import routers # 导入路由集合
|
|
|
|
app = FastAPI(title="FastAPI文档")
|
|
|
|
for router in routers:
|
|
app.include_router(router) # 自动注册所有路由
|
|
|
|
if __name__ == '__main__':
|
|
uvicorn.run(app='main:app', host='0.0.0.0', port=1314, reload=True)
|