Skip to content

Commit

Permalink
fix: remove tokenlist from here
Browse files Browse the repository at this point in the history
  • Loading branch information
Majorfi committed Jun 19, 2023
1 parent d891729 commit 3c80993
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"net/http"
"os"
"strconv"
"strings"
"time"

"github.com/getsentry/sentry-go"
Expand All @@ -13,7 +12,6 @@ import (
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
"github.com/sirupsen/logrus"
"github.com/yearn/ydaemon/common/env"
"github.com/yearn/ydaemon/common/helpers"
"github.com/yearn/ydaemon/common/traces"
"github.com/yearn/ydaemon/external/meta"
Expand All @@ -40,15 +38,11 @@ func middleware(log *logrus.Logger) gin.HandlerFunc {
}

return func(c *gin.Context) {
if strings.HasPrefix(c.Request.RequestURI, "/api/tokens/list") {
c.Header("Cache-Control", "max-age=86400")
} else {
log.WithFields(logrus.Fields{
"path": c.Request.RequestURI,
"method": c.Request.Method,
"status": c.Writer.Status(),
}).Info(time.Now().Format(time.RFC3339))
}
log.WithFields(logrus.Fields{
"path": c.Request.RequestURI,
"method": c.Request.Method,
"status": c.Writer.Status(),
}).Info(time.Now().Format(time.RFC3339))
}
}

Expand Down Expand Up @@ -188,16 +182,17 @@ func NewRouter() *gin.Engine {
GET(router, `:chainID/prices/some/:addresses`, c.GetSomePrices)
}

// WARNING: DEPRECATED
// yBribe API section
{
GET(router, `:chainID/bribes/newRewardFeed`, utils.GetRewardAdded)
}

{
router.StaticFile("api/tokens/list", env.BASE_DATA_PATH+`/meta/tokens/tokenList.json`)
router.StaticFile("tokenlist", env.BASE_DATA_PATH+`/tokensList/public/yearn.json`)
GET(router, `tokenlist/live`, tokensList.GetTokenList)
}
// {
// router.StaticFile("api/tokens/list", env.BASE_DATA_PATH+`/meta/tokens/tokenList.json`)
// router.StaticFile("tokenlist", env.BASE_DATA_PATH+`/tokensList/public/yearn.json`)
// GET(router, `tokenlist/live`, tokensList.GetTokenList)
// }

{
//TEST
Expand Down

0 comments on commit 3c80993

Please sign in to comment.