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

fix(docs): list example and index option #235

Merged
merged 1 commit into from Sep 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Expand Up @@ -173,6 +173,13 @@ This function allows filtering the served files.
If the function returns `true`, the file will be served.
If the function returns `false`, Fastify's 404 handler will be called.

#### `index`

Default: `undefined`

Under the hood we use [send](https://github.com/pillarjs/send#index) lib that by default supports "index.html" files.
To disable this set false or to supply a new index pass a string or an array in preferred order.

#### `list`

Default: `undefined`
Expand All @@ -187,6 +194,7 @@ Default response is json.
fastify.register(require('fastify-static'), {
root: path.join(__dirname, 'public'),
prefix: '/public/',
index: false
list: true
})
```
Expand Down