Fix logo assets and license heartbeat

This commit is contained in:
ShukeBta
2026-06-17 23:30:31 +08:00
parent fb362e1fec
commit 29ac7765d2
11 changed files with 199 additions and 43 deletions
+7
View File
@@ -120,6 +120,7 @@ func main() {
}
}()
go services.Boot()
go handler.RunLicenseHeartbeatLoop(services.Context(), services)
go services.TelegramBot.StartPolling(context.Background())
// Graceful shutdown.
@@ -201,6 +202,12 @@ func serveSPA(r *gin.Engine, webDir string) {
c.Next()
})
assets.Static("/", filepath.Join(webDir, "assets"))
brand := r.Group("/brand")
brand.Use(func(c *gin.Context) {
c.Header("Cache-Control", "public, max-age=86400")
c.Next()
})
brand.Static("/", filepath.Join(webDir, "brand"))
for _, icon := range []string{"/favicon.ico", "/favicon.svg"} {
iconPath := filepath.Join(webDir, strings.TrimPrefix(icon, "/"))
r.GET(icon, serveNoCacheFile(iconPath))