Answer the question
In order to leave comments, you need to log in
golang. How to connect handler (Gin framework) to CloudyKit/jet template?
I have
package main code
import (
"net/http"
"github.com/CloudyKit/jet"
"github.com/gin-gonic/gin"
)
var views = jet.NewHTMLSet("./views")
// var router *gin.Engine
func main() {
router := gin.Default()
// router.Use(gin.Recovery())
router.LoadHTMLGlob("templates/*")
router.StaticFS("/static/", http.Dir("static"))
router.GET("/", func(c *gin.Context) { c.HTML(http.StatusOK, "index.jet", gin.H{"title": "Home Page"}) })
router.Run("192.168.1.107:8001")
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question