Skip to content

Commit 57939ea

Browse files
committed
fix embed
1 parent 8485d17 commit 57939ea

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

aiplan.go/internal/aiplan/middlewares.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import (
1313
"io"
1414
"log/slog"
1515
"net/http"
16+
"path/filepath"
1617
"regexp"
1718
"strings"
1819

@@ -60,7 +61,7 @@ func NewSPACacheMiddleware(config middleware.StaticConfig) func(echo.HandlerFunc
6061

6162
indexHasher := md5.New()
6263

63-
indexF, err := config.Filesystem.Open("index.html")
64+
indexF, err := config.Filesystem.Open(filepath.Join(config.Root, "index.html"))
6465
if err != nil {
6566
slog.Error("Open SPA index file, cache disabled", "err", err)
6667
} else {

aiplan.go/internal/aiplan/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,6 @@ func FormatDateToSqlNullTime(dateStr string) sql.NullTime {
285285
}
286286

287287
func CheckEmbedSPA(fs embed.FS) bool {
288-
d, err := fs.ReadFile("pwa/index.html")
288+
d, err := fs.ReadFile("spa/index.html")
289289
return len(d) > 0 && err == nil
290290
}

0 commit comments

Comments
 (0)