snow/handlers/snow.go
2023-12-07 23:25:17 +00:00

29 lines
518 B
Go

package handlers
import (
"strings"
"github.com/ectrc/snow/fortnite"
"github.com/gofiber/fiber/v2"
)
func GetPreloadedCosmetics(c *fiber.Ctx) error {
return c.JSON(fortnite.Cosmetics)
}
func GetPlaylistImage(c *fiber.Ctx) error {
playlist := c.Params("playlist")
if playlist == "" {
return c.SendStatus(404)
}
playlist = strings.Split(playlist, ".")[0]
image, ok := fortnite.PlaylistImages[playlist]
if !ok {
return c.SendStatus(404)
}
c.Set("Content-Type", "image/png")
return c.Send(image)
}