relynolli-server/handlers/cdek/routes.go

19 lines
379 B
Go
Raw Normal View History

2024-05-03 11:57:53 +03:00
package cdek
import (
"github.com/gin-gonic/gin"
"os"
"relynolli-server/handlers/cdek/endpoints"
)
func HandleRoutes(parent *gin.RouterGroup) {
h := endpoints.GetHandlers()
cdek := parent.Group("/cdek")
if os.Getenv("IS_PROD") == "1" {
// Caching for production usage
cdek.GET("/points", h.GetDeliveryPoints)
} else {
cdek.GET("/points", h.GetDeliveryPoints)
}
}