Agrego guia, reportes y alertas con menu de navegacion

This commit is contained in:
2026-05-22 17:57:48 -06:00
parent f90b9e2fc7
commit e3f659cac8
5 changed files with 373 additions and 0 deletions

29
main.py Normal file
View File

@@ -0,0 +1,29 @@
from fastapi import FastAPI, Request
from fastapi.responses import HTMLResponse
from datetime import datetime
app = FastAPI()
reportes = []
@app.get("/guia", response_class=HTMLResponse)
def guia_separacion():
with open("guia.html", "r", encoding="utf-8") as f:
return f.read()
@app.get("/reportes", response_class=HTMLResponse)
def pagina_reportes():
with open("reportes.html", "r", encoding="utf-8") as f:
return f.read()
@app.get("/alertas", response_class=HTMLResponse)
def pagina_alertas():
with open("alertas.html", "r", encoding="utf-8") as f:
return f.read()
@app.post("/api/reportes")
async def recibir_reporte(request: Request):
datos = await request.json()
datos["fecha"] = datetime.now().strftime("%d/%m/%Y %H:%M")
reportes.append(datos)
return {"mensaje": "Reporte recibido correctamente", "total": len(reportes)}