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

16 lines
305 B
Go

package js
import (
"github.com/labstack/echo/v4"
"net/http"
)
func InitJsGroup(g *echo.Group) {
g.GET("/:name", func(c echo.Context) error {
jsName := c.Param("name")
c.Response().Header().Set("Cache-Control", "max-age=1")
return c.Blob(http.StatusOK, "text/javaScript", jsMap[jsName])
})
}