chore: sync with gin-template

This commit is contained in:
JustSong
2022-11-22 11:04:06 +08:00
parent 8247192977
commit 5913266969
41 changed files with 813 additions and 490 deletions
+2 -1
View File
@@ -2,7 +2,7 @@ package router
import (
"embed"
"github.com/gin-gonic/contrib/static"
"github.com/gin-contrib/static"
"github.com/gin-gonic/gin"
"message-pusher/common"
"message-pusher/middleware"
@@ -11,6 +11,7 @@ import (
func setWebRouter(router *gin.Engine, buildFS embed.FS, indexPage []byte) {
router.Use(middleware.GlobalWebRateLimit())
router.Use(middleware.Cache())
router.Use(static.Serve("/", common.EmbedFolder(buildFS, "web/build")))
router.NoRoute(func(c *gin.Context) {
c.Data(http.StatusOK, "text/html; charset=utf-8", indexPage)