Ai
1 Star 0 Fork 0

码上陪你/ginOceanLearn

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.go 489 Bytes
一键复制 编辑 原始数据 按行查看 历史
码上陪你 提交于 2021-11-12 21:27 +08:00 . 004项目重构关注分离
package main
import (
"OceanLearn/common"
"github.com/gin-gonic/gin"
)
func main() {
db :=common.InitDb()
defer db.Close()
// 1.创建路由
r := gin.Default()
// 2.绑定路由规则,执行的函数
// gin.Context,封装了request和response
//r.POST("/api/auth/register", controller.Register)
r = CollectRoute(r)
// 3.监听端口,默认在8080
// Run("里面不指定端口号默认为8080")
panic(r.Run() )// 监听并在 0.0.0.0:8080 上启动服务
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/codewithyou688/gin-ocean-learn.git
git@gitee.com:codewithyou688/gin-ocean-learn.git
codewithyou688
gin-ocean-learn
ginOceanLearn
master

搜索帮助