import ( | import ( | ||||
"flag" | "flag" | ||||
"fmt" | "fmt" | ||||
"log" | |||||
"net/http" | "net/http" | ||||
"path/filepath" | "path/filepath" | ||||
"runtime" | "runtime" | ||||
fs := http.StripPrefix(prefix, http.FileServer(http.Dir(abs))) | fs := http.StripPrefix(prefix, http.FileServer(http.Dir(abs))) | ||||
self.mux.PathPrefix(prefix).Handler(fs) | self.mux.PathPrefix(prefix).Handler(fs) | ||||
} else { | } else { | ||||
log.Fatalf("Failed to setup file server: %v", err) | |||||
panic("Failed to setup file server: " + err.Error()) | |||||
} | } | ||||
} | } | ||||