mirror of https://github.com/Xhofe/alist
🎇 add public folder router
parent
36f07ee194
commit
958d793725
|
@ -32,7 +32,12 @@ func Static(r *gin.Engine) {
|
|||
if err != nil {
|
||||
log.Fatalf("can't find assets folder")
|
||||
}
|
||||
pub, err := fs.Sub(public.Public, "public")
|
||||
if err != nil {
|
||||
log.Fatalf("can't find public folder")
|
||||
}
|
||||
r.StaticFS("/assets/", http.FS(assets))
|
||||
r.StaticFS("/public/", http.FS(pub))
|
||||
r.NoRoute(func(c *gin.Context) {
|
||||
c.Status(200)
|
||||
c.Header("Content-Type", "text/html")
|
||||
|
|
Loading…
Reference in New Issue