apifiber/routes/routes.go

40 lines
1.1 KiB
Go

package routes
import (
"api/controllers"
"github.com/gofiber/fiber/v2"
)
// Setup sets up the routes
func Setup(app *fiber.App) {
app.Post("/integration", controllers.WixIntegration)
app.Post("/test", controllers.WixTest)
app.Get("/version", controllers.Version)
app.Get("/health", controllers.GetServerInfo)
app.Get("/users", controllers.GetUsers)
app.Get("/groups", controllers.GetGroups)
app.Post("/user", controllers.CreateUser)
// Webhooks
app.Post("/on_server_start", controllers.ServerStart)
app.Post("/on_pub_start", controllers.OnPubStart)
app.Post("/on_pub_stop", controllers.OnPubStop)
app.Post("/on_sub_start", controllers.OnSubStart)
app.Post("/on_sub_stop", controllers.OnSubStop)
// Interfaces of transmissions
app.Get("/transmissions", controllers.GetTransmissions)
app.Get("/transmission/:channel", controllers.GetTransmissionByChannel)
// Interfaces to player
app.Get("/c/:channel", controllers.WatchersCount)
app.Get("/w/:channel", controllers.Watch)
app.Get("/l/:channel", controllers.Leave)
}