Skip to content

[FEATURE REQUEST] - Add Health Check Endpoint #43

Description

@rishyym0927

🚀 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! 👨‍💻👩‍💻

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions