diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -36,6 +36,9 @@ const UNAUTH string = "Unauthorized" //go:embed templates var tmplContent embed.FS +//go:embed static +var staticContent embed.FS + type Doc struct { Name string Size string @@ -649,7 +652,7 @@ func main() { log.Printf("baseDocDir: %s\n", baseDocDir) http.HandleFunc("/docs/", handleFileServer(baseDocDir, "/docs/")) //http.Handle("/docs/", http.StripPrefix("/docs/", http.FileServer(http.Dir("docs")))) - http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.Dir("static")))) + http.Handle("/static/", http.FileServer(http.FS(staticContent))) http.HandleFunc("/", index) //http.HandleFunc("/createuser", createuser) http.HandleFunc("/login", login) |
