feat: save messages to database (close #37)
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"github.com/gin-contrib/static"
|
||||
"github.com/gin-gonic/gin"
|
||||
"message-pusher/common"
|
||||
"message-pusher/controller"
|
||||
"message-pusher/middleware"
|
||||
"net/http"
|
||||
)
|
||||
@@ -12,6 +13,8 @@ import (
|
||||
func setWebRouter(router *gin.Engine, buildFS embed.FS, indexPage []byte) {
|
||||
router.Use(middleware.GlobalWebRateLimit())
|
||||
router.Use(middleware.Cache())
|
||||
router.GET("/public/static/:file", controller.GetStaticFile)
|
||||
router.GET("/message/:link", controller.RenderMessage)
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user