You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
467 B
Go
18 lines
467 B
Go
package http
|
|
|
|
import "github.com/gofiber/fiber/v3"
|
|
|
|
// RegisterRoutes registers leaderboard routes.
|
|
func RegisterRoutes(app *fiber.App, h *Handler, authMiddleware fiber.Handler) {
|
|
lb := app.Group("/leaderboard")
|
|
lb.Get("/top10", h.GetTop10)
|
|
lb.Get("/stats", h.GetStats)
|
|
|
|
protected := app.Group("/leaderboard")
|
|
if authMiddleware != nil {
|
|
protected.Use(authMiddleware)
|
|
}
|
|
protected.Get("/players/:id", h.GetPlayerRanking)
|
|
protected.Post("/update", h.Update)
|
|
}
|