7 Star 34 Fork 12

WANG / golang_blog

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 858 Bytes
一键复制 编辑 原始数据 按行查看 历史
WANG 提交于 2019-12-01 22:48 . 第一次提交
package main
import (
"flag"
"github.com/cihub/seelog"
"wangchunguang_blog/controller"
"wangchunguang_blog/service"
"wangchunguang_blog/system"
)
func main() {
confifFilePath := flag.String("C", "conf/conf.yaml", "config file path")
logConfigPath := flag.String("L", "conf/seelog.xml", "log config file path")
flag.Parse()
logger, err := seelog.LoggerFromConfigAsFile(*logConfigPath)
if err != nil {
seelog.Critical("err parsing seelog config file", err)
return
}
seelog.ReplaceLogger(logger)
defer seelog.Flush()
if err := system.LoadConfiguration(*confifFilePath); err != nil {
seelog.Critical("err parsing config log file", err)
return
}
// 连接数据库
service.ConnectDB()
defer service.DisconnectDB()
// 获取接口地址
router := controller.MapRoutes()
// 请求端口
router.Run(system.GetConfiguration().Addr)
}
Go
1
https://gitee.com/wangchunguang/golang_blog.git
git@gitee.com:wangchunguang/golang_blog.git
wangchunguang
golang_blog
golang_blog
wcg

搜索帮助