Skip to content

Commit

Permalink
Fix static hosting
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Nov 11, 2024
1 parent 1ec9d40 commit 51de8ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions odds/api/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
allow_headers=["*"],
)

# Serve static files from the 'ui' directory on the '/' endpoint
app.mount("/", StaticFiles(directory="ui", html=True), name="static")

@app.get("/datasets")
async def search_datasets_handler(query: str) -> List[Dict[str, Any]]:
return await search_datasets(query, None)
Expand All @@ -47,5 +44,8 @@ async def query_db_handler(resource_id: str, sql: str) -> Optional[Dict[str, Any
async def answer_handler(q: str, catalog_id: Optional[str] = None) -> Optional[Dict[str, Any]]:
return await answer_question(q, catalog_id)

# Serve static files from the 'ui' directory on the '/' endpoint
app.mount("/", StaticFiles(directory="ui", html=True), name="static")

# Run the server with:
# uvicorn server:app --reload

0 comments on commit 51de8ca

Please sign in to comment.