INNER CODE UNIT · Python
create_app
JiayuXu0/FastAPI-Template · src/__init__.py:72
def create_app() -> FastAPI:
app = FastAPI(
title=settings.APP_TITLE,
description=settings.APP_DESCRIPTION,
version=settings.VERSION,
docs_url=None,
redoc_url=None,
openapi_url="/openapi.json",
middleware=make_middlewares(),
lifespan=lifespan,
)
@app.get("/docs", include_in_schema=False)
async def custom_swagger_ui_html(
username: str = Depends(get_current_username),
):
return get_swagger_ui_html(
openapi_url="/openapi.json",