Spaces:
Running
on
Zero
Running
on
Zero
Curinha
commited on
Commit
·
137db14
1
Parent(s):
75b5466
Rename status endpoint to health_check and add redirect to documentation
Browse files
app.py
CHANGED
@@ -27,9 +27,10 @@ class AudioRequest(BaseModel):
|
|
27 |
|
28 |
|
29 |
# Prueba para verificar si la API funciona - la dejamos por ahora para debugging
|
30 |
-
@app.get("/
|
31 |
-
def
|
32 |
-
|
|
|
33 |
|
34 |
|
35 |
@app.post("/generate-sound/")
|
@@ -130,6 +131,9 @@ def home():
|
|
130 |
</html>
|
131 |
"""
|
132 |
|
|
|
|
|
|
|
133 |
|
134 |
if __name__ == "__main__":
|
135 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
27 |
|
28 |
|
29 |
# Prueba para verificar si la API funciona - la dejamos por ahora para debugging
|
30 |
+
@app.get("/health")
|
31 |
+
def health_check():
|
32 |
+
"""Endpoint para verificar que el servicio está funcionando correctamente"""
|
33 |
+
return {"status": "ok", "service": "Sound Generation API"}
|
34 |
|
35 |
|
36 |
@app.post("/generate-sound/")
|
|
|
131 |
</html>
|
132 |
"""
|
133 |
|
134 |
+
@app.get("/docs", response_class=RedirectResponse, status_code=302)
|
135 |
+
async def redirect_to_docs():
|
136 |
+
return "/docs"
|
137 |
|
138 |
if __name__ == "__main__":
|
139 |
uvicorn.run(app, host="0.0.0.0", port=7860)
|