package main import ( "fmt" "github.com/gin-gonic/gin" "jypay/api" "jypay/global" "jypay/initialize" "jypay/utils" ) func main() { global.Config = initialize.InitConfig() global.DB = initialize.InitDB(global.Config) fmt.Println(global.Config) r := gin.Default() r.GET("/ping", utils.BuildJsonHandler(api.Index)) r.GET("/error", utils.BuildJsonHandler(api.Error)) r.POST("/pay", utils.BuildJsonHandler(api.Pay)) r.POST("/payment/:token", utils.BuildHandler(api.Payment)) r.POST("/notify", utils.BuildHandler(api.Notify)) r.GET("/return/:order_no", utils.BuildHandler(api.Return)) r.GET("/test-post", utils.BuildJsonHandler(api.TestPost)) err := r.Run(":" + global.Config.Server.Port) // listen and serve on 0.0.0.0:8080 panic(err) }