codeskyblue / gohttpserver

The best HTTP Static File Server, write with golang+vue
MIT License
2.53k stars 534 forks source link

Make deep path depth configurable #172

Closed krypty closed 9 months ago

krypty commented 1 year ago

Problem

When browsing network paths (e.g. CIFS/SAMBA or s3fs) listing the folders in a combined way can be super slow because it needs to list the dirs within the dirs within the dirs...

I am referring to this feature in the README.md

When only one dir under dir, path will combine two together

Proposition

In this PR, I added a setting that sets the maximum depth to walk into, that defaults to 5 (the current value). Now I can set this setting to -1 which disable the feature and only list one folder at the time. This leads to a faster browsing experience.

Thanks a lot for this project and please tell if how I can improve this if needed. That's my first Golang PR.