Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -78,6 +78,16 @@ def search_books(book_request: BookRequest):
|
|
| 78 |
|
| 79 |
return {"results": results}
|
| 80 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
# Serve React static files (add this section)
|
| 82 |
# Mount static assets (CSS, JS, images)
|
| 83 |
app.mount("/assets", StaticFiles(directory="dist/assets"), name="assets")
|
|
@@ -90,16 +100,6 @@ async def serve_react_app(full_path: str):
|
|
| 90 |
raise HTTPException(status_code=404, detail="Not found")
|
| 91 |
return FileResponse('dist/index.html')
|
| 92 |
|
| 93 |
-
|
| 94 |
-
@app.get("/debug/env")
|
| 95 |
-
def check_env():
|
| 96 |
-
return {
|
| 97 |
-
"LANCEDB_URI_set": bool(os.getenv("LANCEDB_URI")),
|
| 98 |
-
"LANCEDB_API_KEY_set": bool(os.getenv("LANCEDB_API_KEY")),
|
| 99 |
-
"LANCEDB_TABLE_set": bool(os.getenv("LANCEDB_TABLE")),
|
| 100 |
-
"LANCEDB_URI_preview": os.getenv("LANCEDB_URI", "NOT_SET")[:20] + "..." if os.getenv("LANCEDB_URI") else "NOT_SET"
|
| 101 |
-
}
|
| 102 |
-
|
| 103 |
if __name__ == "__main__":
|
| 104 |
import uvicorn
|
| 105 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 78 |
|
| 79 |
return {"results": results}
|
| 80 |
|
| 81 |
+
|
| 82 |
+
@app.get("/debug/env")
|
| 83 |
+
def check_env():
|
| 84 |
+
return {
|
| 85 |
+
"LANCEDB_URI_set": bool(os.getenv("LANCEDB_URI")),
|
| 86 |
+
"LANCEDB_API_KEY_set": bool(os.getenv("LANCEDB_API_KEY")),
|
| 87 |
+
"LANCEDB_TABLE_set": bool(os.getenv("LANCEDB_TABLE")),
|
| 88 |
+
"LANCEDB_URI_preview": os.getenv("LANCEDB_URI", "NOT_SET")[:20] + "..." if os.getenv("LANCEDB_URI") else "NOT_SET"
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
# Serve React static files (add this section)
|
| 92 |
# Mount static assets (CSS, JS, images)
|
| 93 |
app.mount("/assets", StaticFiles(directory="dist/assets"), name="assets")
|
|
|
|
| 100 |
raise HTTPException(status_code=404, detail="Not found")
|
| 101 |
return FileResponse('dist/index.html')
|
| 102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
if __name__ == "__main__":
|
| 104 |
import uvicorn
|
| 105 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|