Skip to content

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

Open
@GwynethLlewelyn

Description

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 :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions