Skip to content

Commit

Permalink
add health endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
aarushik93 committed Oct 15, 2024
1 parent a2ef456 commit b71db62
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 @@ -78,6 +78,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 @@ -640,6 +648,9 @@ def send_execution_update(self, execution_result_dict: dict[Any, Any]):
execution_result = execution_db.ExecutionResult(**execution_result_dict)
self.event_queue.put(execution_result)

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

@classmethod
def update_configuration(
cls,
Expand Down

0 comments on commit b71db62

Please sign in to comment.