mirror of
http://88.130.71.182:3000/BlitTech/contexta_be.git
synced 2026-06-12 23:23:21 +00:00
added analytics
This commit is contained in:
@@ -5,7 +5,7 @@ from fastapi.responses import JSONResponse
|
||||
import logging
|
||||
|
||||
from app.config import settings
|
||||
from app.routers import auth, chatbots, documents, chat, marketplace, billing, models
|
||||
from app.routers import auth, chatbots, documents, chat, marketplace, billing, models, analytics
|
||||
|
||||
# Configure logging
|
||||
logging.basicConfig(
|
||||
@@ -15,15 +15,12 @@ logging.basicConfig(
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
# BUG-13 FIX: Replace deprecated @app.on_event("startup") with lifespan
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
# Startup
|
||||
logger.info("Contexta API starting up...")
|
||||
logger.info(f"Environment: {settings.app_env}")
|
||||
logger.info(f"Allowed origins: {settings.allowed_origins_list}")
|
||||
yield
|
||||
# Shutdown
|
||||
logger.info("Contexta API shutting down...")
|
||||
|
||||
|
||||
@@ -54,6 +51,7 @@ app.include_router(chat.router, prefix="/api/v1")
|
||||
app.include_router(marketplace.router, prefix="/api/v1")
|
||||
app.include_router(billing.router, prefix="/api/v1")
|
||||
app.include_router(models.router, prefix="/api/v1")
|
||||
app.include_router(analytics.router, prefix="/api/v1")
|
||||
|
||||
# ── Health & Info ──────────────────────────────────────────────────────────────
|
||||
@app.get("/")
|
||||
|
||||
Reference in New Issue
Block a user