|
|
@ -32,7 +32,7 @@ func NewServer(ctx context.Context, config *config.Config) *AuthServer { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
s.Router.Get("/api/v1/health", health(s)) |
|
|
|
s.Router.Get("/api/v1/healthz", healthz(s)) |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
s.Router.Post("/api/v1/login", login(s)) |
|
|
|
s.Router.Post("/api/v1/login", login(s)) |
|
|
@ -46,9 +46,9 @@ func (s *AuthServer) GracefulStop() error { |
|
|
|
return s.db.Close() |
|
|
|
return s.db.Close() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func health(s *AuthServer) http.HandlerFunc { |
|
|
|
func healthz(s *AuthServer) http.HandlerFunc { |
|
|
|
return func(w http.ResponseWriter, r *http.Request) { |
|
|
|
return func(w http.ResponseWriter, r *http.Request) { |
|
|
|
w.WriteHeader(200) |
|
|
|
w.WriteHeader(http.StatusOK) |
|
|
|
w.Write([]byte("ok")) |
|
|
|
w.Write([]byte("ok")) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|