INNER CODE UNIT · Python
_cors_origins
ghost-in-the-droid/android-agent · gitd/app.py:50
def _cors_origins() -> list[str]:
"""Return the list of allowed CORS origins, honoring GITD_CORS_ORIGINS."""
override = os.environ.get("GITD_CORS_ORIGINS", "").strip()
if not override:
return list(_DEFAULT_CORS_ORIGINS)
return [o.strip() for o in override.split(",") if o.strip()]
@asynccontextmanager
async def lifespan(app: FastAPI):
"""Startup / shutdown lifecycle."""
Base.metadata.create_all(bind=engine)
from gitd.models.base import ensure_additive_columns
ensure_additive_columns()
from gitd.routers.misc import setup_log_capture
from gitd.services import scheduler_service