2024-06-22 04:29:20 +00:00
|
|
|
package api
|
2024-05-17 07:59:51 +00:00
|
|
|
|
|
|
|
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"),
|
|
|
|
})
|
|
|
|
}
|