Skip to content

Commit

Permalink
feat: add endpoint to get all symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Jul 9, 2024
1 parent cccac8e commit 896127f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions node/pkg/dal/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ func (c *Controller) getLatestSubmissionDataSingle(ctx context.Context, symbol s
}, nil
}

func getSymbols(c *fiber.Ctx) error {
result := []string{}
for key := range ApiController.configs {
result = append(result, key)
}
return c.JSON(result)
}

func getLatestFeeds(c *fiber.Ctx) error {
defer func() {
_ = db.QueryWithoutResult(
Expand Down
1 change: 1 addition & 0 deletions node/pkg/dal/api/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
func Routes(router fiber.Router) {
api := router.Group("/dal")

api.Get("/symbols", getSymbols)
api.Get("/latest-data-feeds/all", getLatestFeeds)
api.Get("/latest-data-feeds/:symbol", getLatestFeed)
api.Get("/ws", websocket.New(ApiController.handleWebsocket))
Expand Down

0 comments on commit 896127f

Please sign in to comment.