From 495dff3de10a5dea7e575011cf437986d88fb610 Mon Sep 17 00:00:00 2001 From: imterah Date: Mon, 23 Dec 2024 19:17:54 -0500 Subject: [PATCH] fix: Fixes API routing for connections. --- backend/api/controllers/v1/proxies/connections.go | 2 +- backend/api/main.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/api/controllers/v1/proxies/connections.go b/backend/api/controllers/v1/proxies/connections.go index 8e7ea8b..a79b2a9 100644 --- a/backend/api/controllers/v1/proxies/connections.go +++ b/backend/api/controllers/v1/proxies/connections.go @@ -37,7 +37,7 @@ type ConnectionsResponse struct { Data []*SanitizedConnection `json:"data"` } -func Connections(c *gin.Context) { +func GetConnections(c *gin.Context) { var req ConnectionsRequest if err := c.BindJSON(&req); err != nil { diff --git a/backend/api/main.go b/backend/api/main.go index 12c13d3..77677c9 100644 --- a/backend/api/main.go +++ b/backend/api/main.go @@ -11,6 +11,7 @@ import ( "git.terah.dev/imterah/hermes/api/backendruntime" "git.terah.dev/imterah/hermes/api/controllers/v1/backends" + "git.terah.dev/imterah/hermes/api/controllers/v1/forward" "git.terah.dev/imterah/hermes/api/controllers/v1/proxies" "git.terah.dev/imterah/hermes/api/controllers/v1/users" "git.terah.dev/imterah/hermes/api/dbcore" @@ -201,6 +202,7 @@ func entrypoint(cCtx *cli.Context) error { engine.POST("/api/v1/forward/remove", proxies.RemoveProxy) engine.POST("/api/v1/forward/start", proxies.StartProxy) engine.POST("/api/v1/forward/stop", proxies.StopProxy) + engine.POST("/api/v1/forward/connections", forward.GetConnections) log.Infof("Listening on '%s'", listeningAddress) err = engine.Run(listeningAddress)