Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /SHAdd0WTAka_Zen-Ai-Pentest /zen_teams /backend /app /main.py
| """Zen-Teams FastAPI Application""" | |
| from contextlib import asynccontextmanager | |
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from app.config import settings | |
| from app.database import close_db, init_db | |
| from app.routers import agents, bridge, companies, personas, tickets, websocket | |
| async def lifespan(app: FastAPI): | |
| """Application lifespan handler""" | |
| # Startup | |
| await init_db() | |
| yield | |
| # Shutdown | |
| await close_db() | |
| app = FastAPI( | |
| title=settings.APP_NAME, | |
| version=settings.APP_VERSION, | |
| description="AI Team Management for Zen-AI-Pentest", | |
| lifespan=lifespan, | |
| ) | |
| # CORS | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=settings.CORS_ORIGINS, | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| # Routers | |
| app.include_router(companies.router, prefix="/api/v1/companies", tags=["companies"]) | |
| app.include_router(agents.router, prefix="/api/v1/agents", tags=["agents"]) | |
| app.include_router(tickets.router, prefix="/api/v1/tickets", tags=["tickets"]) | |
| app.include_router(websocket.router, prefix="/api/v1/ws", tags=["websocket"]) | |
| app.include_router(bridge.router, prefix="/api/v1/bridge", tags=["zen-ai-pentest"]) | |
| app.include_router(personas.router, prefix="/api/v1/personas", tags=["personas"]) | |
| async def health_check(): | |
| return {"status": "healthy", "app": settings.APP_NAME, "version": settings.APP_VERSION} | |
| async def root(): | |
| return { | |
| "app": settings.APP_NAME, | |
| "version": settings.APP_VERSION, | |
| "docs": "/docs", | |
| "health": "/health", | |
| } | |
Xet Storage Details
- Size:
- 1.64 kB
- Xet hash:
- 38b45c42908e1436a802807ba7d2955aa05f5f692d2fade7525441d4341901ef
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.