PhotosAPI/modules/app.py

24 lines
697 B
Python
Raw Normal View History

2023-02-16 15:56:28 +02:00
from fastapi import FastAPI
2022-12-20 02:22:32 +02:00
from fastapi.openapi.docs import get_swagger_ui_html, get_redoc_html
2023-03-23 13:34:31 +02:00
app = FastAPI(title="END PLAY Photos", docs_url=None, redoc_url=None, version="0.2")
2022-12-20 02:22:32 +02:00
2023-03-12 15:59:13 +02:00
2022-12-20 02:22:32 +02:00
@app.get("/docs", include_in_schema=False)
async def custom_swagger_ui_html():
return get_swagger_ui_html(
2023-03-12 15:59:13 +02:00
openapi_url=app.openapi_url, # type: ignore
2022-12-20 02:22:32 +02:00
title=app.title + " - Documentation",
2023-03-12 15:59:13 +02:00
swagger_favicon_url="/favicon.ico",
2022-12-20 02:22:32 +02:00
)
2023-03-12 15:59:13 +02:00
2022-12-20 02:22:32 +02:00
@app.get("/redoc", include_in_schema=False)
async def custom_redoc_html():
return get_redoc_html(
2023-03-12 15:59:13 +02:00
openapi_url=app.openapi_url, # type: ignore
2022-12-20 02:22:32 +02:00
title=app.title + " - Documentation",
2023-03-12 15:59:13 +02:00
redoc_favicon_url="/favicon.ico",
)