This commit is contained in:
18
config/app.py
Normal file
18
config/app.py
Normal file
@ -0,0 +1,18 @@
|
||||
from fastapi import FastAPI
|
||||
from config.settings import settings
|
||||
from api.v1.routers import api_router
|
||||
|
||||
def create_app(lifespan=None) -> FastAPI:
|
||||
app = FastAPI(
|
||||
title=settings.APP_NAME,
|
||||
debug=settings.DEBUG,
|
||||
lifespan=lifespan,
|
||||
)
|
||||
|
||||
# 注册路由
|
||||
app.include_router(api_router, prefix="/api/v1")
|
||||
|
||||
return app
|
||||
|
||||
|
||||
# app = create_app()
|
||||
Reference in New Issue
Block a user