Moibe commited on
Commit
a77cdcc
·
1 Parent(s): 913877b

Add Health Check

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -2,10 +2,21 @@ import funciones
2
  from fastapi import FastAPI, Form
3
  from fastapi import FastAPI, File, UploadFile
4
  from typing import Literal
 
5
 
6
  app = FastAPI()
7
 
8
- #Future Importante, los errores como no detección de rostro, deben ser devueltos por ésta API.
 
 
 
 
 
 
 
 
 
 
9
 
10
  @app.post("/partynight/")
11
  async def partynight(
 
2
  from fastapi import FastAPI, Form
3
  from fastapi import FastAPI, File, UploadFile
4
  from typing import Literal
5
+ from fastapi.responses import JSONResponse
6
 
7
  app = FastAPI()
8
 
9
+ # Nuevo endpoint para Health Check
10
+ @app.get("/health",
11
+ tags=["Health Check"],
12
+ description="Verifica el estado de salud de la API.",
13
+ summary="Health Check"
14
+ )
15
+ async def health_check():
16
+ """
17
+ Este endpoint devuelve una respuesta 200 OK para indicar que la API está funcionando.
18
+ """
19
+ return JSONResponse(content={"status": "ok"}, status_code=200)
20
 
21
  @app.post("/partynight/")
22
  async def partynight(