move common static files, 503 on unavailable services
This commit is contained in:
parent
7b92f97b24
commit
b2485eda79
47 changed files with 36 additions and 9 deletions
|
|
@ -73,8 +73,8 @@ func New(ctx context.Context) (*Service, error) {
|
|||
|
||||
func (srv *Service) BindRoutes(group *gin.RouterGroup) {
|
||||
group.GET("/public/*path", func(ctx *gin.Context) {
|
||||
path := strings.TrimPrefix(ctx.Request.URL.Path, "/music/")
|
||||
http.ServeFileFS(ctx.Writer, ctx.Request, publicFS, path)
|
||||
filepath := strings.TrimPrefix(ctx.Request.URL.Path, "/music/")
|
||||
http.ServeFileFS(ctx.Writer, ctx.Request, publicFS, filepath)
|
||||
})
|
||||
|
||||
group.GET("/sse", func(ctx *gin.Context) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue