1 Star 0 Fork 8

feiman/gdshop-admin-go-api

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 737 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"fmt"
_ "gdshop-admin-go-api/boot"
_ "gdshop-admin-go-api/router"
"github.com/gogf/gcache-adapter/adapter"
"github.com/gogf/gf/encoding/gjson"
"github.com/gogf/gf/frame/g"
)
func main() {
s := g.Server()
//s.SetPort(8001)
// 平滑重启,win不支持,先屏蔽掉
//s.EnableAdmin()
encode, err := gjson.Encode(g.Cfg().GetMap("redis"))
if err != nil {
return
}
fmt.Println(string(encode))
adapterRedis := adapter.NewRedis(g.Redis())
g.DB().GetCache().SetAdapter(adapterRedis)
s.Start()
staticServer := g.Server("static")
staticServer.SetIndexFolder(true)
staticServer.SetServerRoot(g.Cfg().GetString("upload.WwwrootPath"))
staticServer.SetPort(8802)
staticServer.Start()
g.Wait()
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/feiman8888/gdshop-admin-go-api.git
git@gitee.com:feiman8888/gdshop-admin-go-api.git
feiman8888
gdshop-admin-go-api
gdshop-admin-go-api
master

搜索帮助