You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
451 B
24 lines
451 B
package main
|
|
|
|
import (
|
|
"dsCommonTools/Router"
|
|
"dsCommonTools/Utils"
|
|
"dsCommonTools/Utils/ConfigUtil"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func main() {
|
|
// 发布模式
|
|
//gin.SetMode(gin.ReleaseMode)
|
|
// 开发模式
|
|
gin.SetMode(gin.DebugMode)
|
|
// 开启gin服务器
|
|
r := gin.Default()
|
|
// 使用跨域中间件
|
|
r.Use(Utils.Cors())
|
|
//主路由
|
|
Router.GinRouter(r)
|
|
// 监听并在 0.0.0.0:8002 上启动服务
|
|
r.Run(":" + ConfigUtil.ServerPort)
|
|
}
|