π Overview
The backend currently lacks a health check endpoint. Adding a /health endpoint will allow monitoring tools and developers to check if the application is running and if the database connection is healthy.
π Use Case
- Helps in monitoring the application's uptime.
- Enables automated health checks for load balancers and orchestrators.
- Allows developers to quickly diagnose issues with the backend or database.
π Expected Behavior
- Create a new file
healthCheck.go in the controllers folder.
- Implement a handler function that:
- Returns 200 OK if the application is running.
- Uses
DB.Ping() to check the database connection and includes the result in the response.
- Add a /health route in the router.
- Test the endpoint using Postman or curl.
π Skills Required
- Go programming
- HTTP routing in Go
- Database connection handling
Thank you for contributing to StoreHUB! π¨βπ»π©βπ»
π Overview
The backend currently lacks a health check endpoint. Adding a
/healthendpoint will allow monitoring tools and developers to check if the application is running and if the database connection is healthy.π Use Case
π Expected Behavior
healthCheck.goin thecontrollersfolder.DB.Ping()to check the database connection and includes the result in the response.π Skills Required
Thank you for contributing to StoreHUB! π¨βπ»π©βπ»