fix: Fixes API routing for connections.
This commit is contained in:
parent
af6ee6ab66
commit
495dff3de1
2 changed files with 3 additions and 1 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue