1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: serve static file from local fs when on dev (fix #176)

This commit is contained in:
Ferdinand Mütsch
2021-04-16 12:24:19 +02:00
parent a9739a6db0
commit b9ea6530f9
4 changed files with 31 additions and 5 deletions

View File

@@ -205,7 +205,8 @@ func main() {
// Static Routes
// https://github.com/golang/go/issues/43431
static, _ := fs.Sub(staticFiles, "static")
embeddedStatic, _ := fs.Sub(staticFiles, "static")
static := conf.ChooseFS("static", embeddedStatic)
fileServer := http.FileServer(utils.NeuteredFileSystem{Fs: http.FS(static)})
router.PathPrefix("/contribute.json").Handler(fileServer)
router.PathPrefix("/assets").Handler(fileServer)