Spaces:
Running
Running
File size: 1,062 Bytes
00a7923 cbf3fcf 00a7923 cbf3fcf 00a7923 cbf3fcf 00a7923 cbf3fcf 00a7923 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | """
FastAPI application for API Blackbox.
"""
from fastapi import FastAPI
from fastapi.responses import JSONResponse
from routers.procesador import router as procesador_router
app = FastAPI(
title="API Blackbox",
description="Para correr cualquier API de forma agnóstica a sus inputs, outputs o especificación.",
version="1.0.0",
)
@app.get("/", tags=["blackbox"])
async def root():
"""
Root endpoint.
Returns:
dict: Welcome message
"""
return {
"message": "Welcome to API Blackbox",
"docs": "/docs",
"redoc": "/redoc"
}
@app.get("/health", tags=["blackbox"])
async def health_check():
"""
Health check endpoint.
Returns:
dict: Status of the application
"""
return JSONResponse(
status_code=200,
content={
"status": "healthy",
"message": "API is running"
}
)
app.include_router(procesador_router)
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=7860)
|