22 lines
309 B
Go
22 lines
309 B
Go
package controller
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
func Init() *gin.Engine {
|
|
gin.SetMode(gin.DebugMode)
|
|
|
|
app := gin.New()
|
|
app.Use(gin.Logger())
|
|
app.Use(gin.Recovery())
|
|
|
|
// static files
|
|
app.Static("/public", "./public")
|
|
|
|
// HTML templates
|
|
app.HTMLRender = templatePath("views")
|
|
|
|
return app
|
|
}
|