package apps import ( "github.com/labstack/echo/v4" "net/http" ) func InitStaticGroup(g *echo.Group) { g.GET("login.html", func(c echo.Context) error { c.Response().Header().Set("Content-Type", "text/html; charset=utf-8") c.Response().Header().Set("Cache-Control", "max-age=3600") return c.File("static/login.html") }) g.GET("css/login.css", func(c echo.Context) error { c.Response().Header().Set("Cache-Control", "max-age=3600") return c.File("static/css/login.css") }) g.GET("img/003.jpeg", func(c echo.Context) error { c.Response().Header().Set("Cache-Control", "max-age=3600") return c.File("static/img/003.jpeg") }) g.GET("/aa", func(c echo.Context) error { c.Response().Header().Set("Content-Type", "text/html; charset=utf-8") return c.String(http.StatusOK, `

html代码

`) }) }