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

@ -412,6 +412,7 @@ type (
// Unfortunately, this function is very unreliable for pulling chronological
// subscription records. Twitch API does not currently provide a mechanism for
// fetching the latest subscriber; this will need to be tracked manually.
/*
func (srv *Service) getSubscribers(
ctx context.Context,
broadcasterID string,
@ -442,3 +443,4 @@ func (srv *Service) getSubscribers(
return resData, nil
}
*/

View file

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Twitch Labels</title>
<link rel="stylesheet" href="/music/public/fonts/inter/inter.css">
<link rel="stylesheet" href="/public/fonts/inter/inter.css">
<link rel="stylesheet" href="/twitch/public/labels.css">
</head>
<body>

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) {