From 9d1819c0703d46011752e48dfabcb77b89a43b90 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 22 Mar 2024 08:49:41 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=A9=20/doc=20endpoint=20added?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.py | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/src/index.py b/src/index.py index f4e2cb4..a395e1b 100644 --- a/src/index.py +++ b/src/index.py @@ -10,7 +10,7 @@ import uvicorn from dotenv import load_dotenv from fastapi import FastAPI, HTTPException, Query -from fastapi.responses import FileResponse +from fastapi.responses import FileResponse, HTMLResponse app = FastAPI(title="HiFi-RestAPI", version="v1.0") @@ -223,6 +223,47 @@ async def get_track( ) +@app.api_route("/doc", methods=["GET"]) +async def doc(): + return HTMLResponse( + """ + + + + + API Reference + + + + + + + + + + + + + + + + +""" + ) + + @app.api_route("/song/", methods=["GET"]) async def get_song(q: str, quality: str): try: