oprimized, working

This commit is contained in:
royalcat 2023-12-22 02:15:39 +03:00
parent 2b39afca3b
commit 0350ecba9a
38 changed files with 1809 additions and 826 deletions
src/http

View file

@ -8,6 +8,7 @@ import (
"git.kmsign.ru/royalcat/tstor/src/config"
"git.kmsign.ru/royalcat/tstor/src/host/torrent"
"github.com/anacrolix/missinggo/v2/filecache"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
"github.com/rs/zerolog/log"
"github.com/shurcooL/httpfs/html/vfstemplate"
@ -19,6 +20,7 @@ func New(fc *filecache.Cache, ss *torrent.Stats, s *torrent.Service, logPath str
r.Use(gin.Recovery())
r.Use(gin.ErrorLogger())
r.Use(Logger())
pprof.Register(r)
r.GET("/assets/*filepath", func(c *gin.Context) {
c.FileFromFS(c.Request.URL.Path, http.FS(tstor.Assets))