diff --git a/pkg/server/server.go b/pkg/server/server.go index a89e04a..d10ccd7 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -125,6 +125,7 @@ func (s *Server) Serve() error { } // always available public routes go here (none at the moment) + router.HandleFunc("/configurator/status", s.GetStatus) s.Handler = router return s.ListenAndServe() @@ -225,6 +226,19 @@ func (s *Server) loadTargets() { } } +func (s *Server) GetStatus(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json") + data := map[string]any{ + "code": 200, + "message": "Configurator is healthy", + } + err := json.NewEncoder(w).Encode(data) + if err != nil { + fmt.Printf("failed to encode JSON: %v\n", err) + return + } +} + // Create a new target with name, generator, templates, and files. // // Example: