From 958d7937253713020fa7b11d50e6f2931ded9005 Mon Sep 17 00:00:00 2001 From: Xhofe Date: Sat, 25 Dec 2021 17:07:59 +0800 Subject: [PATCH] :sparkler: add public folder router --- server/static.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/static.go b/server/static.go index 7dc09d0b..e6a0842b 100644 --- a/server/static.go +++ b/server/static.go @@ -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")