24 lines
388 B
Go
24 lines
388 B
Go
package routes
|
|
|
|
import (
|
|
"errors"
|
|
"strings"
|
|
|
|
"github.com/labstack/echo/v4"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
var ErrInvalidPath = errors.New("invalid path")
|
|
|
|
func SetupRoutes(
|
|
e *echo.Echo,
|
|
) {
|
|
|
|
cfg := viper.GetViper()
|
|
prefixURL := strings.TrimRight(cfg.GetString("API_PREFIX"), "/")
|
|
mainPrefix := e.Group(prefixURL)
|
|
|
|
setupMemberRoutes(e, mainPrefix)
|
|
setupRankRoutes(e, mainPrefix)
|
|
}
|