forked from trustwallet/blockatlas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmeta.go
35 lines (30 loc) · 744 Bytes
/
meta.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"github.com/gin-gonic/gin"
"github.com/spf13/viper"
"net/http"
)
func getRoot(c *gin.Context) {
c.String(http.StatusOK,
`Welcome to the Block Atlas API!
Don't know how you landed here?
Visit https://trustwallet.com to get back to the main page.
If you know what you're doing:
- Visit /v1/ to list platforms
- Source: https://github.com/trustwallet/blockatlas
- Any questions? https://t.me/walletcore
`)
}
func getEnabledEndpoints(c *gin.Context) {
var resp struct {
Endpoints []string `json:"endpoints"`
}
for ns := range loaders {
key := ns + ".api"
if !viper.IsSet(key) || viper.GetString(key) == "" {
continue
}
resp.Endpoints = append(resp.Endpoints, ns)
}
c.JSON(http.StatusOK, &resp)
}