From 0ea836c69ce178ed87710617cfb7d5b5190346da Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Mon, 26 Jan 2026 13:17:36 +0100 Subject: [PATCH] Revert metricstore api paths --- cmd/cc-backend/server.go | 2 +- internal/api/rest.go | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmd/cc-backend/server.go b/cmd/cc-backend/server.go index c6e30824..4035c430 100644 --- a/cmd/cc-backend/server.go +++ b/cmd/cc-backend/server.go @@ -136,7 +136,7 @@ func (s *Server) init() error { userapi := s.router.PathPrefix("/userapi").Subrouter() configapi := s.router.PathPrefix("/config").Subrouter() frontendapi := s.router.PathPrefix("/frontend").Subrouter() - metricstoreapi := s.router.PathPrefix("/metricstore").Subrouter() + metricstoreapi := s.router.PathPrefix("/api").Subrouter() if !config.Keys.DisableAuthentication { // Create login failure handler (used by both /login and /jwt-login) diff --git a/internal/api/rest.go b/internal/api/rest.go index 27374f6e..c0fa7c2a 100644 --- a/internal/api/rest.go +++ b/internal/api/rest.go @@ -123,15 +123,15 @@ func (api *RestAPI) MountUserAPIRoutes(r *mux.Router) { func (api *RestAPI) MountMetricStoreAPIRoutes(r *mux.Router) { // REST API Uses TokenAuth // Note: StrictSlash handles trailing slash variations automatically - r.HandleFunc("/api/free", freeMetrics).Methods(http.MethodPost) - r.HandleFunc("/api/write", writeMetrics).Methods(http.MethodPost) - r.HandleFunc("/api/debug", debugMetrics).Methods(http.MethodGet) - r.HandleFunc("/api/healthcheck", metricsHealth).Methods(http.MethodGet) + r.HandleFunc("/free", freeMetrics).Methods(http.MethodPost) + r.HandleFunc("/write", writeMetrics).Methods(http.MethodPost) + r.HandleFunc("/debug", debugMetrics).Methods(http.MethodGet) + r.HandleFunc("/healthcheck", metricsHealth).Methods(http.MethodGet) // Same endpoints but with trailing slash - r.HandleFunc("/api/free/", freeMetrics).Methods(http.MethodPost) - r.HandleFunc("/api/write/", writeMetrics).Methods(http.MethodPost) - r.HandleFunc("/api/debug/", debugMetrics).Methods(http.MethodGet) - r.HandleFunc("/api/healthcheck/", metricsHealth).Methods(http.MethodGet) + r.HandleFunc("/free/", freeMetrics).Methods(http.MethodPost) + r.HandleFunc("/write/", writeMetrics).Methods(http.MethodPost) + r.HandleFunc("/debug/", debugMetrics).Methods(http.MethodGet) + r.HandleFunc("/healthcheck/", metricsHealth).Methods(http.MethodGet) } // MountConfigAPIRoutes registers configuration and user management endpoints.