diff --git a/admin/app.go b/admin/app.go index 0352cf2b..b7691dec 100644 --- a/admin/app.go +++ b/admin/app.go @@ -4,6 +4,8 @@ import ( "context" "log" "net/http" + "path/filepath" + "strings" "time" "github.com/gin-gonic/gin" @@ -33,6 +35,10 @@ func NewApp(cfg *settings.Settings, baseURL string, bind string) App { router.GET("/", func(c *gin.Context) { c.Redirect(http.StatusFound, baseURL) }) + router.GET(filepath.Dir(baseURL)+"/files/*_", func(c *gin.Context) { + path := c.Request.URL.Path + c.Redirect(http.StatusFound, filepath.Join(baseURL, strings.TrimPrefix(path, filepath.Dir(baseURL)))) + }) baserouter = router.Group(baseURL) diff --git a/admin/static/views/exercice.html b/admin/static/views/exercice.html index dd38fac2..7b80e71a 100644 --- a/admin/static/views/exercice.html +++ b/admin/static/views/exercice.html @@ -96,7 +96,7 @@
- +