chore(deps): add gin-contrib/gzip for response compression

Add `github.com/gin-contrib/gzip` to the module dependencies and update `go.sum` with the newly introduced transitive dependencies, preparing the Gin server for gzip-compressed responses.chore(deps): add gin-contrib/gzip for response compression

Add `github.com/gin-contrib/gzip` to the module dependencies and update `go.sum` with the newly introduced transitive dependencies, preparing the Gin server for gzip-compressed responses.
This commit is contained in:
2026-04-25 18:04:10 +03:00
parent 6e29f644ba
commit 87aa4cc6f2
49 changed files with 419 additions and 4 deletions

View File

@@ -1,13 +1,22 @@
package server
import "github.com/gin-gonic/gin"
import (
"net/http"
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
)
func Run(addr string) error {
router := gin.Default()
router.LoadHTMLGlob("templates/*.html")
router.GET("/", func(ctx *gin.Context) {
ctx.String(200, "ok")
ctx.HTML(http.StatusOK, "index.html", gin.H{})
})
compressed := router.Group("/", gzip.Gzip(gzip.DefaultCompression))
compressed.Static("/static", "./static")
return router.Run(addr)
}