1 Star 0 Fork 0

copylian/goHelpers

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
http-server.go 771 Bytes
一键复制 编辑 原始数据 按行查看 历史
copylian 提交于 2023-04-24 15:57 +08:00 . a
// http入口
package main
import (
"fmt"
router "goHelpers/routes"
"gitee.com/copylian/lian-go.git/bootstrap"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
)
// 端口
const ServiceHostPort = ":50051"
// 项目名称
const ProjectName = "goHelpers"
// main main函数
func main() {
// 设置项目名称
bootstrap.SetProjectName(ProjectName)
// 初始化环境
bootstrap.Init()
// 中间件
middleFun := []gin.HandlerFunc{
// middleware.CheckUserAuth(),
}
// 初始化gin http
r := bootstrap.InitWeb(middleFun)
// pprof 性能监测
pprof.Register(r)
// 注册路由
router.RegisterRouter(r)
// 监听
fmt.Printf("Listen on%s\n", ServiceHostPort)
// 启动
r.Run(ServiceHostPort)
//bootstrap.RunWeb(r, ServiceHostPort)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/copylian/go-helpers.git
git@gitee.com:copylian/go-helpers.git
copylian
go-helpers
goHelpers
master

搜索帮助