Skip to content

Commit

Permalink
[PTFE-681] Fastapi router routes (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaspardmoindrot authored Aug 4, 2023
1 parent ca1b99f commit e4f79a6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runner_manager/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@

from runner_manager.dependencies import get_queue
from runner_manager.jobs.startup import startup
from runner_manager.routers import webhook

log = logging.getLogger(__name__)

app = FastAPI()

app.include_router(webhook.router)


@app.on_event("startup")
def startup_event():
Expand Down
Empty file.
8 changes: 8 additions & 0 deletions runner_manager/routers/webhook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from fastapi import APIRouter, Response

router = APIRouter(prefix="/webhook")


@router.get("/")
def get():
return Response(content="Success", status_code=200)
3 changes: 3 additions & 0 deletions tests/api/test_webhook.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def test_get_webhook(client):
response = client.get("/webhook")
assert response.status_code == 200

0 comments on commit e4f79a6

Please sign in to comment.