1 Star 0 Fork 0

acrowise/base-framework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 1.10 KB
一键复制 编辑 原始数据 按行查看 历史
Cloudy 提交于 2018-10-22 11:36 . 增加性能监控
// Copyright 2018 cloudy [email protected]. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package main
import (
"flag"
"fmt"
"github.com/itcloudy/base-framework/common"
"github.com/itcloudy/base-framework/router"
"github.com/itcloudy/base-framework/system"
"os"
"path"
)
func main() {
var err error
fPath, _ := os.Getwd()
fPath = path.Join(fPath, "conf")
configPath := flag.String("c", fPath, "config file path")
flag.Parse()
err = system.LoadConfigInformation(*configPath)
if err != nil {
return
}
//router init
router := router.InitRouter()
server := common.ServerInfo
serverInfo := common.StringsJoin(server.Host, ":", server.Port)
// restart
if server.EnableHttps {
fmt.Println("server start https")
err := router.RunTLS(serverInfo, server.CertFile, server.KeyFile)
if err != nil {
fmt.Println("server start failed ", err.Error())
}
} else {
fmt.Printf("server start info: %s\n", serverInfo)
err := router.Run(serverInfo)
if err != nil {
fmt.Println("server start failed ", err.Error())
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/acrowise/base-framework.git
[email protected]:acrowise/base-framework.git
acrowise
base-framework
base-framework
master

搜索帮助