Download app.py from armaanalam/CodeBase-Agent: direct link, hf CLI and curl.
- Browser
- Download file 732 Bytes
-
https://huggingface.co/armaanalam/CodeBase-Agent/resolve/main/app.py
- Command line
-
hf download hf://armaanalam/CodeBase-Agent/app.py
-
curl -L -o app.py https://huggingface.co/armaanalam/CodeBase-Agent/resolve/main/app.py
732 Bytes
| from fastapi import FastAPI | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from api.routes import router | |
| from mcp_client import get_github_mcp_client | |
| app = FastAPI(title="AI Codebase Assistant") | |
| app.add_middleware( | |
| CORSMiddleware, | |
| allow_origins=["*"], | |
| allow_credentials=True, | |
| allow_methods=["*"], | |
| allow_headers=["*"], | |
| ) | |
| app.include_router(router, prefix="/api") | |
| mcp_client_instance = get_github_mcp_client() | |
| async def startup_event(): | |
| await mcp_client_instance.connect() | |
| async def shutdown_event(): | |
| await mcp_client_instance.disconnect() | |
| def health_check(): | |
| return {"status": "ok"} |