Update index endpoint to serve HTML from static directory
Browse files
main.py
CHANGED
@@ -119,12 +119,11 @@ class TokenResponse(BaseModel):
|
|
119 |
refresh_token: str
|
120 |
token_type: str
|
121 |
|
122 |
-
app.mount("/home", StaticFiles(directory="static", html=True), name="home")
|
123 |
|
124 |
# Root endpoint
|
125 |
@app.get("/")
|
126 |
def index() -> FileResponse:
|
127 |
-
return FileResponse(path="/
|
128 |
|
129 |
# Login endpoint to issue tokens
|
130 |
@app.post("/login", response_model=TokenResponse)
|
@@ -178,6 +177,8 @@ def search(
|
|
178 |
|
179 |
return results
|
180 |
|
|
|
|
|
181 |
# Run the app
|
182 |
if __name__ == "__main__":
|
183 |
import uvicorn
|
|
|
119 |
refresh_token: str
|
120 |
token_type: str
|
121 |
|
|
|
122 |
|
123 |
# Root endpoint
|
124 |
@app.get("/")
|
125 |
def index() -> FileResponse:
|
126 |
+
return FileResponse(path="static/index.html", media_type="text/html")
|
127 |
|
128 |
# Login endpoint to issue tokens
|
129 |
@app.post("/login", response_model=TokenResponse)
|
|
|
177 |
|
178 |
return results
|
179 |
|
180 |
+
app.mount("/home", StaticFiles(directory="static", html=True), name="home")
|
181 |
+
|
182 |
# Run the app
|
183 |
if __name__ == "__main__":
|
184 |
import uvicorn
|