Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request] Add slightly more documentation for the parameters in static.LocalFile #45

Open
GwynethLlewelyn opened this issue Aug 31, 2023 · 0 comments

Comments

@GwynethLlewelyn
Copy link

While the first parameter in static.LocalFile is obvious, the second one — dealing with directory index files — is not. Namely, it's not really obvious that false actually means "skip the index.html file on the root of this directory" (or something like that).

Please consider one of the following:

  1. Add a little more documentation explaining what this parameter is for, and in which cases it's best to leave it on false;
  2. Add two new constants, say, static.UseIndexHTML and static.SkipIndexHTML or something descriptive like that, which get set to true and false respectively (to avoid breaking earlier code).

(or consider both!)

It's far easier to understand what r.Use(static.Serve("/static"), static.LocalFile("/path/to/static/files", static.SkipIndexHTML)) means — especially when looking at code after several months or years without remembering what true and false do in this case :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant