Skip to content

Commit

Permalink
fix(docs): list example and index option (#235)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziimakc committed Sep 28, 2021
1 parent a1a02cd commit 2e97bdd
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 2e97bdd

Please sign in to comment.