...
|
...
|
@@ -2,16 +2,16 @@ package beego |
|
|
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"os"
|
|
|
"strconv"
|
|
|
|
|
|
"github.com/beego/beego/v2/server/web/context"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/constant"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/middleware"
|
|
|
"os"
|
|
|
"strconv"
|
|
|
|
|
|
"github.com/beego/beego/v2/server/web"
|
|
|
"github.com/linmadan/egglib-go/web/beego/filters"
|
|
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
|
|
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/log"
|
|
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-gateway/pkg/port/beego/routers"
|
|
|
)
|
|
|
|
...
|
...
|
@@ -20,6 +20,7 @@ func init() { |
|
|
web.BConfig.CopyRequestBody = true
|
|
|
web.BConfig.RunMode = "dev"
|
|
|
web.BConfig.Listen.HTTPPort = constant.HTTP_PORT
|
|
|
|
|
|
web.BConfig.Listen.EnableAdmin = false
|
|
|
web.BConfig.WebConfig.CommentRouterPath = "/pkg/port/beego/routers"
|
|
|
if os.Getenv("RUN_MODE") != "" {
|
...
|
...
|
@@ -31,6 +32,12 @@ func init() { |
|
|
web.BConfig.Listen.HTTPPort = port
|
|
|
}
|
|
|
}
|
|
|
//https支持
|
|
|
web.BConfig.Listen.EnableHTTPS = false
|
|
|
web.BConfig.Listen.HTTPSPort = 80
|
|
|
web.BConfig.Listen.HTTPSCertFile = ""
|
|
|
web.BConfig.Listen.HTTPSKeyFile = ""
|
|
|
|
|
|
filters.SecureKeyMap["token"] = "x-mmm-accesstoken"
|
|
|
web.InsertFilter("/*", web.BeforeRouter, filters.AllowCors())
|
|
|
web.InsertFilter("/*", web.BeforeRouter, filters.CreateRequstLogFilter(log.Logger))
|
...
|
...
|
|