diff --git a/.gitignore b/.gitignore index 7ef456ccb..e585825b8 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ artifacts/ storybook-static/ test-results.xml + +docsite/ diff --git a/pkg/docsite/docsite.go b/pkg/docsite/docsite.go index 3e83fdfc8..949054d86 100644 --- a/pkg/docsite/docsite.go +++ b/pkg/docsite/docsite.go @@ -9,11 +9,10 @@ import ( "github.com/wavetermdev/waveterm/pkg/wavebase" ) -var docsiteStaticPath = filepath.Join(wavebase.GetWaveAppPath(), "docsite") - var docsiteHandler http.Handler func GetDocsiteHandler() http.Handler { + docsiteStaticPath := filepath.Join(wavebase.GetWaveAppPath(), "docsite") stat, err := os.Stat(docsiteStaticPath) if docsiteHandler == nil { log.Println("Docsite is nil, initializing") @@ -21,7 +20,7 @@ func GetDocsiteHandler() http.Handler { log.Printf("Found static site at %s, serving\n", docsiteStaticPath) docsiteHandler = http.FileServer(HTMLDir{http.Dir(docsiteStaticPath)}) } else { - log.Println("Did not find static site, serving not found handler") + log.Printf("Did not find static site at %s, serving not found handler. stat: %v, err: %v\n", docsiteStaticPath, stat, err) docsiteHandler = http.NotFoundHandler() } }