在线客服系统源码开发实战总结:gin框架模板渲染html页面
渲染模板
我的客服系统后端使用的golang Gin 框架,想把页面渲染出来,下面就是加载html模板页面
package router
func InitViewRouter(engine *gin.Engine) {
//关于页面
engine.GET("/aboutus.html", func(c *gin.Context) {
c.HTML(http.StatusOK, "aboutus.html", gin.H{
"nav": "aboutus",
})
})
//演示页面
engine.GET("/show.html", func(c *gin.Context) {
c.HTML(http.StatusOK, "show.html", gin.H{
"nav": "show",
})
})
}


