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"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"strings"
|
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"codeberg.org/arimelody/ari-stream-tools/config"
|
"codeberg.org/arimelody/ari-stream-tools/config"
|
||||||
|
|
@ -73,7 +72,8 @@ func main() {
|
||||||
|
|
||||||
public := srv.Group("/public")
|
public := srv.Group("/public")
|
||||||
public.GET("/*path", func(ctx *gin.Context) {
|
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)
|
http.ServeFileFS(ctx.Writer, ctx.Request, static.PublicFS, filepath)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue