move common static files, 503 on unavailable services

This commit is contained in:
ari melody 2026-07-24 12:41:36 +01:00
parent 7b92f97b24
commit b2485eda79
Signed by: ari
GPG key ID: CF99829C92678188
47 changed files with 36 additions and 9 deletions

View file

@ -178,8 +178,8 @@ func New(ctx context.Context, opts ServiceOptions) (*Service, error) {
func (srv *Service) BindRoutes(group *gin.RouterGroup) {
group.GET("/public/*path", func(ctx *gin.Context) {
path := strings.TrimPrefix(ctx.Request.URL.Path, "/twitch/")
http.ServeFileFS(ctx.Writer, ctx.Request, publicFS, path)
filepath := strings.TrimPrefix(ctx.Request.URL.Path, "/twitch/")
http.ServeFileFS(ctx.Writer, ctx.Request, publicFS, filepath)
})
group.GET("/login", func(ctx *gin.Context) {