方法 1
http.ServeFile(c.Writer,c.Request,"index.html")
方法 2
template.Must(template.ParseFiles("web-05/upload.html")).Execute(c.Writer, nil)
方法 3
r.LoadHTMLGlob("template/*")
r.GET("/", func(c *gin.Context) {
//http.ServeFile(c.Writer,c.Request,"index.html")
c.HTML(200,"index.html",gin.H{})
})
有疑问加站长微信联系(非本文作者)