Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from pydantic import BaseModel
|
| 3 |
from datetime import datetime
|
|
|
|
|
|
|
| 4 |
|
| 5 |
app = FastAPI(title="1HIT RTC Signaling API")
|
| 6 |
|
|
@@ -17,6 +19,16 @@ class IceCandidate(BaseModel):
|
|
| 17 |
|
| 18 |
# ---------- Basic Endpoints ----------
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
@app.get("/")
|
| 22 |
def root():
|
|
|
|
| 1 |
from fastapi import FastAPI
|
| 2 |
from pydantic import BaseModel
|
| 3 |
from datetime import datetime
|
| 4 |
+
from fastapi.openapi.docs import get_swagger_ui_html
|
| 5 |
+
|
| 6 |
|
| 7 |
app = FastAPI(title="1HIT RTC Signaling API")
|
| 8 |
|
|
|
|
| 19 |
|
| 20 |
# ---------- Basic Endpoints ----------
|
| 21 |
|
| 22 |
+
# ---------- 4️⃣ Explicit Swagger docs endpoint ----------
|
| 23 |
+
@app.get("/docs", include_in_schema=False)
|
| 24 |
+
async def custom_swagger_ui_html():
|
| 25 |
+
return get_swagger_ui_html(
|
| 26 |
+
openapi_url=app.openapi_url,
|
| 27 |
+
title=app.title + " - Swagger UI",
|
| 28 |
+
oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
|
| 29 |
+
swagger_js_url="https://unpkg.com/[email protected]/swagger-ui-bundle.js",
|
| 30 |
+
swagger_css_url="https://unpkg.com/[email protected]/swagger-ui.css",
|
| 31 |
+
)
|
| 32 |
|
| 33 |
@app.get("/")
|
| 34 |
def root():
|