This commit is contained in:
20
main.go
20
main.go
@@ -58,13 +58,13 @@ func staticFileServer(content embed.FS) gin.HandlerFunc {
|
||||
|
||||
// Root request should load index.htm
|
||||
if len(fileName) == 1 {
|
||||
//log.Printf("staticFileServer replacing root request with index.html")
|
||||
log.Printf("staticFileServer replacing root request with index.html")
|
||||
fileName = "www/index.html"
|
||||
} else {
|
||||
fileName = strings.TrimLeft(fileName, "/")
|
||||
}
|
||||
|
||||
//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
|
||||
file, err := content.Open(fileName)
|
||||
@@ -124,16 +124,14 @@ func main() {
|
||||
log.Printf("SMT starting execution. Built on %s from sha1 %s\n", buildTime, sha1ver)
|
||||
|
||||
// for debugging, list all the files that we embedded at compile time
|
||||
/*
|
||||
files, err := getAllFilenames(&staticContent)
|
||||
if err != nil {
|
||||
log.Printf("Unable to access embedded fs : '%s'\n", err)
|
||||
}
|
||||
files, err := getAllFilenames(&staticContent)
|
||||
if err != nil {
|
||||
log.Printf("Unable to access embedded fs : '%s'\n", err)
|
||||
}
|
||||
|
||||
for i := range files {
|
||||
log.Printf("Embedded file : '%s'\n", files[i])
|
||||
}
|
||||
*/
|
||||
for i := range files {
|
||||
log.Printf("Embedded file : '%s'\n", files[i])
|
||||
}
|
||||
|
||||
// Initiate connection to sqlite and make sure our schema is up to date
|
||||
models.ConnectDatabase()
|
||||
|
Reference in New Issue
Block a user