gateway/main.go

24 lines
421 B
Go
Raw Normal View History

2021-08-31 09:39:38 +08:00
package main
import (
"fmt"
"gateway/config"
2021-09-07 13:40:44 +08:00
"gateway/core"
"gateway/initialization"
"gateway/middleware"
2021-08-31 09:39:38 +08:00
"github.com/gin-gonic/gin"
)
func main() {
2021-09-07 13:40:44 +08:00
// 初始化系统
initialization.InitSystem()
// 创建默认Web服务
2021-08-31 09:39:38 +08:00
app := gin.Default()
2021-09-07 13:40:44 +08:00
app.Use(middleware.GenRequestId(), middleware.OpenTracing())
2021-08-31 09:39:38 +08:00
2021-09-07 13:40:44 +08:00
app.Any("/*action", core.NacosClient.Remote)
2021-08-31 09:39:38 +08:00
_ = app.Run(fmt.Sprintf(":%v", config.AppInfo.Port))
2021-08-31 09:39:38 +08:00
}