Skip to content

Conversation

@Sophie-Ag00001
Copy link
Collaborator

# Add Health Check Endpoint

## Summary
This PR introduces a health check endpoint to the API. The changes include:
- Adding a `health_check` function in `src/api/handlers.rs`.
- Updating routes in `src/api/routes.rs` for each node type (User, Storage, Mempool, Miner, Miner+User) to include the health check endpoint.
- Adding a unit test for the `/health` route.

## Motivation
The health check endpoint is essential for monitoring the status of the service. It provides a simple way to verify that the service is operational and healthy.

## Context
The health check endpoint returns a straightforward response indicating the service is healthy. This is a common practice in microservices and distributed systems to ensure reliability and ease of monitoring.

## Testing
To test the changes:
1. Run the unit tests using `cargo test`.
2. Manually verify the `/health` endpoint by sending a request to it and ensuring it returns the expected response.

## Known Issues
- None at this time.

2. In src/api/routes.rs, for each node type (User, Storage, Mempool, Miner, Miner+User):
   a. Add the provided .or(...) block with the health_check handler.
3. Add unit test for the /health route

ONLY work on these files, no others
@Sophie-Ag00001 Sophie-Ag00001 requested a review from a team as a code owner January 10, 2025 06:39
@BHouwens BHouwens closed this Jan 10, 2025
@BHouwens BHouwens deleted the feature/api-handlersrs-add-provided branch January 13, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants