package apis import ( "errors" "net/http" "github.com/gin-gonic/gin" "gorm.io/gorm" ) var db *gorm.DB func BindAPIs(r *gin.Engine, cfg_db *gorm.DB) error { if cfg_db == nil { return errors.New("Database is null") } db = cfg_db r.GET("/", func(c *gin.Context) { c.JSON(http.StatusOK, gin.H{ "message": "pong", }) }) bindPlanAPIs(r) bindPollAPIs(r) bindUserAPIs(r) return nil }