fix(middleware): update public paths in TenantMiddleware and adjust API routes in main.py
This commit is contained in:
@@ -29,8 +29,9 @@ app = FastAPI(
|
||||
title="Anexo76 API",
|
||||
version=settings.APP_VERSION,
|
||||
description="Aplicación SaaS para gestión de comercio exterior conforme a Anexos 24, 31 y 22 del SAT",
|
||||
docs_url="/docs" if settings.DEBUG else None,
|
||||
redoc_url="/redoc" if settings.DEBUG else None
|
||||
docs_url="/api/docs" if settings.DEBUG else None,
|
||||
redoc_url="/api/redoc" if settings.DEBUG else None,
|
||||
openapi_url="/api/openapi.json" if settings.DEBUG else None,
|
||||
)
|
||||
|
||||
# Configurar CORS
|
||||
@@ -51,18 +52,18 @@ app.add_middleware(TenantMiddleware)
|
||||
app.include_router(api_v1_router, prefix="/api/v1")
|
||||
|
||||
|
||||
@app.get("/")
|
||||
@app.get("/api/")
|
||||
async def root():
|
||||
"""Root endpoint"""
|
||||
return {
|
||||
"name": "Anexo76 API",
|
||||
"version": settings.APP_VERSION,
|
||||
"status": "running",
|
||||
"docs": "/docs" if settings.DEBUG else "disabled in production"
|
||||
"docs": "/api/docs" if settings.DEBUG else "disabled in production"
|
||||
}
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
@app.get("/api/health")
|
||||
async def health_check():
|
||||
"""Health check endpoint"""
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user