diff --git a/cmd/dwelling-files/main.go b/cmd/dwelling-files/main.go index 8cde8f5..e219c54 100644 --- a/cmd/dwelling-files/main.go +++ b/cmd/dwelling-files/main.go @@ -43,6 +43,10 @@ func main() { r.Handler(http.MethodGet, "/*filepath", Index) r.ServeStatic("/assets/*filepath", web.Assets()) + if (*directoryPath)[len(*directoryPath)-1] == '/' { + *directoryPath = (*directoryPath)[:len(*directoryPath)-1] + } + var fileServer http.Handler if *enableFileHandler { fileServer = http.FileServer(http.Dir(*directoryPath))