Skip to content

Commit

Permalink
security(platform/backend): Add health endpoint (#8341)
Browse files Browse the repository at this point in the history
* add health endpoint

* fix linting

---------

Co-authored-by: Nicholas Tindle <[email protected]>
  • Loading branch information
aarushik93 and ntindle authored Oct 16, 2024
1 parent 6f07d24 commit 2d0e51f
Showing 1 changed file with 11 additions and 0 deletions.
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,
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(self):
return {"status": "healthy"}

@classmethod
def update_configuration(
cls,
Expand Down

0 comments on commit 2d0e51f

Please sign in to comment.