feat: enhance health check endpoint to include GitHub client ID
This commit is contained in:
parent
a8cfd74d4c
commit
701988fca8
1 changed files with 13 additions and 3 deletions
|
|
@ -4,12 +4,22 @@ package v0
|
|||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/modelcontextprotocol/registry/internal/config"
|
||||
)
|
||||
|
||||
type HealthResponse struct {
|
||||
Status string `json:"status"`
|
||||
GitHubClientId string `json:"github_client_id"`
|
||||
}
|
||||
|
||||
// HealthHandler returns a handler for health check endpoint
|
||||
func HealthHandler() http.HandlerFunc {
|
||||
func HealthHandler(cfg *config.Config) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
|
||||
json.NewEncoder(w).Encode(HealthResponse{
|
||||
Status: "ok",
|
||||
GitHubClientId: cfg.GithubClientID,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue