Paperclip/pkg/internal/server/api/well_known_api.go
2024-06-22 18:09:41 +08:00

19 lines
340 B
Go

package api
import (
"github.com/gofiber/fiber/v2"
"github.com/spf13/viper"
)
func getDestinations(c *fiber.Ctx) error {
var data []string
for key := range viper.GetStringMap("destinations") {
data = append(data, key)
}
return c.JSON(fiber.Map{
"data": data,
"preferred": viper.GetString("preferred_destination"),
})
}