Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

security(platform/backend): Add health endpoint #8341

Merged
merged 4 commits into from
Oct 16, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions autogpt_platform/backend/backend/server/rest_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@ def run_service(self):
allow_headers=["*"], # Allows all headers
)

health_router = APIRouter()
health_router.add_api_route(
path="/health",
endpoint=self.health_check,
methods=["GET"],
tags=["health"],
)

# Define the API routes
api_router = APIRouter(prefix="/api")
api_router.dependencies.append(Depends(auth_middleware))
Expand Down Expand Up @@ -632,6 +640,9 @@ def get_execution_schedules(
execution_scheduler = self.execution_scheduler_client
return execution_scheduler.get_execution_schedules(graph_id, user_id)

async def health_check(self):
return {"status": "healthy"}

@classmethod
def update_configuration(
cls,
Expand Down
Loading