mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-27 15:41:41 +01:00
24 lines
625 B
Go
24 lines
625 B
Go
package server
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/sablierapp/sablier/internal/api"
|
|
"github.com/sablierapp/sablier/pkg/sablier"
|
|
)
|
|
|
|
func registerRoutes(router *gin.Engine, s *sablier.Sablier) {
|
|
// Enables automatic redirection if the current route cannot be matched but a
|
|
// handler for the path with (without) the trailing slash exists.
|
|
router.RedirectTrailingSlash = true
|
|
|
|
// Create REST API router group.
|
|
APIv1 := router.Group("/api")
|
|
|
|
api.StartBlocking(APIv1, s)
|
|
api.StartDynamic(APIv1, s)
|
|
api.GetGroups(APIv1, s)
|
|
api.GetThemes(APIv1, s)
|
|
api.PreviewTheme(APIv1, s)
|
|
api.ListInstances(APIv1, s)
|
|
}
|