Actually fix the bug

This commit is contained in:
Aaron Dewes 2022-02-01 20:57:28 +01:00
parent 1ea6ce082b
commit f8f8525b01
1 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import (
"embed"
"flag"
"fmt"
"io/fs"
"log"
"net/http"
"os"
@ -68,8 +69,12 @@ func main() {
return c.HTML(200, indexPage)
})
}
assetSubdir, err := fs.Sub(embeddedAssets, "files/assets")
if err != nil {
log.Fatal(err)
}
// Embed static files and serve those on /lnme (e.g. /lnme/lnme.js)
assetHandler := http.FileServer(http.FS(embeddedAssets))
assetHandler := http.FileServer(http.FS(assetSubdir))
e.GET("/lnme/*", echo.WrapHandler(http.StripPrefix("/lnme/", assetHandler)))
// CORS settings