fix: Fixes API routing for connections.

This commit is contained in:
imterah 2024-12-23 19:17:54 -05:00
parent af6ee6ab66
commit 495dff3de1
Signed by: imterah
GPG key ID: 8FA7DD57BA6CEA37
2 changed files with 3 additions and 1 deletions

View file

@ -37,7 +37,7 @@ type ConnectionsResponse struct {
Data []*SanitizedConnection `json:"data"` Data []*SanitizedConnection `json:"data"`
} }
func Connections(c *gin.Context) { func GetConnections(c *gin.Context) {
var req ConnectionsRequest var req ConnectionsRequest
if err := c.BindJSON(&req); err != nil { if err := c.BindJSON(&req); err != nil {

View file

@ -11,6 +11,7 @@ import (
"git.terah.dev/imterah/hermes/api/backendruntime" "git.terah.dev/imterah/hermes/api/backendruntime"
"git.terah.dev/imterah/hermes/api/controllers/v1/backends" "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/proxies"
"git.terah.dev/imterah/hermes/api/controllers/v1/users" "git.terah.dev/imterah/hermes/api/controllers/v1/users"
"git.terah.dev/imterah/hermes/api/dbcore" "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/remove", proxies.RemoveProxy)
engine.POST("/api/v1/forward/start", proxies.StartProxy) engine.POST("/api/v1/forward/start", proxies.StartProxy)
engine.POST("/api/v1/forward/stop", proxies.StopProxy) engine.POST("/api/v1/forward/stop", proxies.StopProxy)
engine.POST("/api/v1/forward/connections", forward.GetConnections)
log.Infof("Listening on '%s'", listeningAddress) log.Infof("Listening on '%s'", listeningAddress)
err = engine.Run(listeningAddress) err = engine.Run(listeningAddress)