mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
feat: track forwards to display on a home page widget (#1623)
* feat: track forwards to display on a home page widget * fix: test * chore: improve copy * feat: configure PPM routing fees
This commit is contained in:
parent
0ac8cc5e25
commit
16eff34b8a
20 changed files with 331 additions and 14 deletions
|
|
@ -181,6 +181,7 @@ func (httpSvc *HttpService) RegisterSharedRoutes(e *echo.Echo) {
|
|||
restrictedApiGroup.POST("/autoswap", httpSvc.enableAutoSwapOutHandler)
|
||||
restrictedApiGroup.DELETE("/autoswap", httpSvc.disableAutoSwapOutHandler)
|
||||
restrictedApiGroup.POST("/node/alias", httpSvc.setNodeAliasHandler)
|
||||
restrictedApiGroup.GET("/forwards", httpSvc.forwardsHandler)
|
||||
|
||||
httpSvc.albyHttpSvc.RegisterSharedRoutes(restrictedApiGroup, e)
|
||||
}
|
||||
|
|
@ -1491,3 +1492,14 @@ func (httpSvc *HttpService) setNodeAliasHandler(c echo.Context) error {
|
|||
|
||||
return c.NoContent(http.StatusNoContent)
|
||||
}
|
||||
|
||||
func (httpSvc *HttpService) forwardsHandler(c echo.Context) error {
|
||||
forwards, err := httpSvc.api.GetForwards()
|
||||
if err != nil {
|
||||
return c.JSON(http.StatusInternalServerError, ErrorResponse{
|
||||
Message: fmt.Sprintf("Failed to get forwards: %s", err.Error()),
|
||||
})
|
||||
}
|
||||
|
||||
return c.JSON(http.StatusOK, forwards)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue