feat: complete cmpp platform phases 0-5
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package health
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Status struct {
|
||||
Status string `json:"status"`
|
||||
Service string `json:"service"`
|
||||
Timestamp string `json:"timestamp"`
|
||||
}
|
||||
|
||||
func Handler() http.Handler {
|
||||
mux := http.NewServeMux()
|
||||
mux.HandleFunc("/health", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
_ = json.NewEncoder(w).Encode(Status{
|
||||
Status: "ok",
|
||||
Service: "cmpp-gateway",
|
||||
Timestamp: time.Now().UTC().Format(time.RFC3339Nano),
|
||||
})
|
||||
})
|
||||
return mux
|
||||
}
|
||||
Reference in New Issue
Block a user