File size: 768 Bytes
12fac92 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # If app.mount is at line 197, why does it return 404?
# Notice what happened earlier. I ran it locally, and `http://127.0.0.1:7860/ocr/ready` returned 503 instead of 404!
# Wait, locally I ran `uvicorn api:app`. On HF Space, the Dockerfile has `CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]`
# Are they identical?
# YES. So why is HF space returning 404?
# The HTTP logs inside my bash curl trace for HF Space:
# `< x-proxied-path: /ocr/ready`
# Wait, HF Space forwards the path unmodified!
# But wait, look closely at the `curl` output:
# `{"detail":"Not Found"}`
# This is a VERY specific error.
# Is my `app.mount("/ocr", ocr_app)` actually catching it?
# In FastAPI, mounted applications MIGHT require a trailing slash, or behave differently.
|