17 lines
336 B
Go
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)
|
|
})
|
|
}
|