go语言框架gin的中文文档.pdfVIP

  • 15
  • 0
  • 约1.06万字
  • 约 9页
  • 2023-07-16 发布于上海
  • 举报
go语⾔框架gin的中⽂⽂档 安装与配置 安装: $ go get gopkg.in/gin-gonic/gin.v1 注意:确保 GOPATH GOROOT 已经配置 导⼊: import gopkg.in/gin-gonic/gin.v1 框架架构 HTTP 服务器 1.默认服务器 router.Run() 2.HTTP 服务器 除了默认服务器中 router.Run() 的⽅式外,还可以⽤ http.ListenAndServe() ,⽐如 func main() { router := gin.Default() http.ListenAndServe(:8080, router) } 或者⾃定义 HTTP 服务器的配置: func main() { router := gin.Default() s := http.Server{ Addr: :8080, Handler: router, ReadTimeout: 10 * time.Second, WriteTimeout: 10 * time.Seco

文档评论(0)

1亿VIP精品文档

相关文档