gin返回html


r := gin.Default()

// 加载模板文件
r.LoadHTMLGlob("templates/**/*")
//r.LoadHTMLFiles("templates/posts/index.html", "templates/users/index.html")

// HTML文件中引用了静态文件时
r.Static("/html中使用的起始路径", "/文件真实路径")

相关