eli02 commited on
Commit
d27470b
·
1 Parent(s): a04b514

Update index endpoint to serve HTML from static directory

Browse files
Files changed (1) hide show
  1. main.py +3 -2
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="/app/home/index.html", media_type="text/html")
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