Skip to content

Commit

Permalink
Fix production build
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmacdonald committed Jan 13, 2025
1 parent 77aaefc commit 6e05126
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions frontend/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package frontend

import (
"embed"
"errors"
"log/slog"
"net/http"

"github.com/gin-contrib/static"
Expand All @@ -20,11 +22,11 @@ func AddRoutes(engine *gin.Engine, _ string) error {
c.Redirect(http.StatusMovedPermanently, "/")
})

//indexData, errIndex := embedFS.ReadFile("dist/index.html")
//if errIndex != nil {
// slog.Warn("")
// return errors.Join(errIndex, ErrContentRoot)
//}
indexData, errIndex := embedFS.ReadFile("dist/index.html")
if errIndex != nil {
slog.Error("Failed to read index.html")
return errors.Join(errIndex, ErrContentRoot)
}

for _, rt := range jsRoutes {
engine.GET(rt, func(ctx *gin.Context) {
Expand Down

0 comments on commit 6e05126

Please sign in to comment.