fix global static files not being served correctly
This commit is contained in:
parent
65e5cf97fc
commit
4d0efce2e0
1 changed files with 2 additions and 2 deletions
|
|
@ -6,7 +6,6 @@ import (
|
|||
"log"
|
||||
"net/http"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"codeberg.org/arimelody/ari-stream-tools/config"
|
||||
|
|
@ -73,7 +72,8 @@ func main() {
|
|||
|
||||
public := srv.Group("/public")
|
||||
public.GET("/*path", func(ctx *gin.Context) {
|
||||
filepath := strings.TrimPrefix(ctx.Request.URL.Path, "/public/")
|
||||
filepath := ctx.Request.URL.Path
|
||||
log.Printf("serving %s from static FS...", filepath)
|
||||
http.ServeFileFS(ctx.Writer, ctx.Request, static.PublicFS, filepath)
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue