Spaces:
Runtime error
Runtime error
Commit
•
41212e8
1
Parent(s):
b231c1a
chore: Add redirect from root URL to /docs
Browse files
main.py
CHANGED
@@ -8,6 +8,8 @@ from data_loader import refresh_data
|
|
8 |
import numpy as np
|
9 |
from pandas import Timestamp
|
10 |
import logging
|
|
|
|
|
11 |
|
12 |
logger = logging.getLogger(__name__)
|
13 |
|
@@ -108,6 +110,11 @@ async def lifespan(app: FastAPI):
|
|
108 |
app = FastAPI(lifespan=lifespan)
|
109 |
|
110 |
|
|
|
|
|
|
|
|
|
|
|
111 |
class SearchResponse(BaseModel):
|
112 |
total: int
|
113 |
page: int
|
|
|
8 |
import numpy as np
|
9 |
from pandas import Timestamp
|
10 |
import logging
|
11 |
+
from starlette.responses import RedirectResponse
|
12 |
+
|
13 |
|
14 |
logger = logging.getLogger(__name__)
|
15 |
|
|
|
110 |
app = FastAPI(lifespan=lifespan)
|
111 |
|
112 |
|
113 |
+
@app.get("/", include_in_schema=False)
|
114 |
+
def root():
|
115 |
+
return RedirectResponse(url="/docs")
|
116 |
+
|
117 |
+
|
118 |
class SearchResponse(BaseModel):
|
119 |
total: int
|
120 |
page: int
|