This commit is contained in:
@@ -10,3 +10,4 @@ go build -ldflags "-X main.sha1ver=`git rev-parse HEAD` -X main.buildTime=$now"
|
|||||||
echo "build complete"
|
echo "build complete"
|
||||||
sha256sum smt > smt_checksum.txt
|
sha256sum smt > smt_checksum.txt
|
||||||
ls -lah
|
ls -lah
|
||||||
|
ls -lah www
|
4
main.go
4
main.go
@@ -29,7 +29,7 @@ type Replacements map[string]string
|
|||||||
|
|
||||||
var replacements = make(Replacements)
|
var replacements = make(Replacements)
|
||||||
|
|
||||||
//go:embed www
|
//go:embed www/*
|
||||||
var staticContent embed.FS
|
var staticContent embed.FS
|
||||||
|
|
||||||
// staticFileServer serves files from the provided fs.FS
|
// staticFileServer serves files from the provided fs.FS
|
||||||
@@ -47,7 +47,7 @@ func staticFileServer(content embed.FS) gin.HandlerFunc {
|
|||||||
//log.Printf("staticFileServer attempting to load filename '%s'\n", fileName)
|
//log.Printf("staticFileServer attempting to load filename '%s'\n", fileName)
|
||||||
|
|
||||||
// Try to open the file from the embedded FS
|
// Try to open the file from the embedded FS
|
||||||
file, err := content.Open("www/" + fileName)
|
file, err := content.Open(fileName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.String(http.StatusNotFound, "File not found")
|
c.String(http.StatusNotFound, "File not found")
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user