Spaces:
Running
Running
Commit ·
ebdd03f
1
Parent(s): b1eab91
Add HEAD method for root endpoint in app.py
Browse files- Introduced a new HEAD method for the root endpoint to allow clients to check the availability of the API without retrieving the full response.
- Enhanced logging to track calls to the new HEAD endpoint, maintaining consistency with existing logging practices.
app.py
CHANGED
|
@@ -58,6 +58,10 @@ def root():
|
|
| 58 |
logger.info("Root endpoint called.")
|
| 59 |
return {"message": "Welcome! This API is for transcription. Try /health or /transcribe."}
|
| 60 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 61 |
|
| 62 |
@app.get("/health")
|
| 63 |
def health():
|
|
|
|
| 58 |
logger.info("Root endpoint called.")
|
| 59 |
return {"message": "Welcome! This API is for transcription. Try /health or /transcribe."}
|
| 60 |
|
| 61 |
+
@app.head("/")
|
| 62 |
+
def root_head():
|
| 63 |
+
logger.info("Root HEAD endpoint called.")
|
| 64 |
+
return {"message": "Welcome! This API is for transcription. Try /health or /transcribe."}
|
| 65 |
|
| 66 |
@app.get("/health")
|
| 67 |
def health():
|