mylomen-server/static/css/static_router.go
shaoyongjun ab00b85c8f to:sync
2024-10-31 01:32:52 +08:00

17 lines
336 B
Go

package css
import (
"github.com/labstack/echo/v4"
"net/http"
)
func InitCssGroup(g *echo.Group) {
g.GET("/:name", func(c echo.Context) error {
cssName := c.Param("name")
c.Response().Header().Set("Cache-Control", "max-age=1")
data, _ := cssMap[cssName]
return c.Blob(http.StatusOK, "text/css; charset=utf-8", data)
})
}