diff --git a/src/factory.py b/src/factory.py index 3c19d15..7d825d3 100644 --- a/src/factory.py +++ b/src/factory.py @@ -1,4 +1,5 @@ from fastapi import FastAPI +from src.routers.github import github_router from src.routers.health import health_router from starlette.middleware.cors import CORSMiddleware @@ -23,5 +24,6 @@ def create_app() -> FastAPI: allow_origins=[str(origin) for origin in ServerConfig.CORS_ORIGINS], ) app.include_router(health_router, prefix="/health") + app.include_router(github_router, prefix="/webhook/github") return app diff --git a/src/routers/github/__init__.py b/src/routers/github/__init__.py new file mode 100644 index 0000000..f2eca46 --- /dev/null +++ b/src/routers/github/__init__.py @@ -0,0 +1 @@ +from src.routers.github.routes import router as github_router diff --git a/src/routers/github/routes.py b/src/routers/github/routes.py new file mode 100644 index 0000000..c8a0935 --- /dev/null +++ b/src/routers/github/routes.py @@ -0,0 +1,12 @@ +from typing import Dict + +from fastapi import APIRouter + + +router = APIRouter() + + +@router.post("/") +async def webhook() -> Dict[str, str]: + """Webhook for GitHub endpoint""" + return {"status": "ok"}