mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-01-28 06:51:45 +01:00
Revert metricstore api paths
This commit is contained in:
@@ -136,7 +136,7 @@ func (s *Server) init() error {
|
|||||||
userapi := s.router.PathPrefix("/userapi").Subrouter()
|
userapi := s.router.PathPrefix("/userapi").Subrouter()
|
||||||
configapi := s.router.PathPrefix("/config").Subrouter()
|
configapi := s.router.PathPrefix("/config").Subrouter()
|
||||||
frontendapi := s.router.PathPrefix("/frontend").Subrouter()
|
frontendapi := s.router.PathPrefix("/frontend").Subrouter()
|
||||||
metricstoreapi := s.router.PathPrefix("/metricstore").Subrouter()
|
metricstoreapi := s.router.PathPrefix("/api").Subrouter()
|
||||||
|
|
||||||
if !config.Keys.DisableAuthentication {
|
if !config.Keys.DisableAuthentication {
|
||||||
// Create login failure handler (used by both /login and /jwt-login)
|
// Create login failure handler (used by both /login and /jwt-login)
|
||||||
|
|||||||
@@ -123,15 +123,15 @@ func (api *RestAPI) MountUserAPIRoutes(r *mux.Router) {
|
|||||||
func (api *RestAPI) MountMetricStoreAPIRoutes(r *mux.Router) {
|
func (api *RestAPI) MountMetricStoreAPIRoutes(r *mux.Router) {
|
||||||
// REST API Uses TokenAuth
|
// REST API Uses TokenAuth
|
||||||
// Note: StrictSlash handles trailing slash variations automatically
|
// Note: StrictSlash handles trailing slash variations automatically
|
||||||
r.HandleFunc("/api/free", freeMetrics).Methods(http.MethodPost)
|
r.HandleFunc("/free", freeMetrics).Methods(http.MethodPost)
|
||||||
r.HandleFunc("/api/write", writeMetrics).Methods(http.MethodPost)
|
r.HandleFunc("/write", writeMetrics).Methods(http.MethodPost)
|
||||||
r.HandleFunc("/api/debug", debugMetrics).Methods(http.MethodGet)
|
r.HandleFunc("/debug", debugMetrics).Methods(http.MethodGet)
|
||||||
r.HandleFunc("/api/healthcheck", metricsHealth).Methods(http.MethodGet)
|
r.HandleFunc("/healthcheck", metricsHealth).Methods(http.MethodGet)
|
||||||
// Same endpoints but with trailing slash
|
// Same endpoints but with trailing slash
|
||||||
r.HandleFunc("/api/free/", freeMetrics).Methods(http.MethodPost)
|
r.HandleFunc("/free/", freeMetrics).Methods(http.MethodPost)
|
||||||
r.HandleFunc("/api/write/", writeMetrics).Methods(http.MethodPost)
|
r.HandleFunc("/write/", writeMetrics).Methods(http.MethodPost)
|
||||||
r.HandleFunc("/api/debug/", debugMetrics).Methods(http.MethodGet)
|
r.HandleFunc("/debug/", debugMetrics).Methods(http.MethodGet)
|
||||||
r.HandleFunc("/api/healthcheck/", metricsHealth).Methods(http.MethodGet)
|
r.HandleFunc("/healthcheck/", metricsHealth).Methods(http.MethodGet)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MountConfigAPIRoutes registers configuration and user management endpoints.
|
// MountConfigAPIRoutes registers configuration and user management endpoints.
|
||||||
|
|||||||
Reference in New Issue
Block a user