snow/handlers/snow.go

29 lines
518 B
Go
Raw Normal View History

package handlers
import (
2023-12-07 23:25:17 +00:00
"strings"
"github.com/ectrc/snow/fortnite"
"github.com/gofiber/fiber/v2"
)
2023-12-07 23:25:17 +00:00
func GetPreloadedCosmetics(c *fiber.Ctx) error {
return c.JSON(fortnite.Cosmetics)
2023-12-07 23:25:17 +00:00
}
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)
}