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:
Roland 2025-08-21 18:09:03 +07:00 committed by GitHub
parent 0ac8cc5e25
commit 16eff34b8a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 331 additions and 14 deletions

View file

@ -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)
}